How to use the brainrender.Utils.data_io.save_npy_to_gz function in brainrender

To help you get started, we’ve selected a few brainrender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / brainrender / ABA / volumetric / VolumetricConnectomeAPI.py View on Github external
self.voxel_array = VoxelConnectivityArray(weights, nodes)

                # Get target and source masks
                self.source_mask = self.cache.get_source_mask()
                self.target_mask = self.cache.get_target_mask()
            else:
                print("Loading voxel data, might take a few minutes.")
                # load from standard cache
                (
                    self.voxel_array,
                    self.source_mask,
                    self.target_mask,
                ) = self.cache.get_voxel_connectivity_array()

                # save to npy
                save_npy_to_gz(
                    weights_file + ".npy.gz", self.voxel_array.weights
                )
                save_npy_to_gz(nodes_file + ".npy.gz", self.voxel_array.nodes)
github BrancoLab / BrainRender / brainrender / ABA / volumetric / VolumetricConnectomeAPI.py View on Github external
def save_to_cache(self, tgt, what, obj):
        """ Saves data to cache to avoid loading thema again in the future"""
        name, cache_path, _ = self._get_cache_filename(tgt, what)
        save_npy_to_gz(cache_path, obj)
github BrancoLab / BrainRender / brainrender / ABA / volumetric / VolumetricConnectomeAPI.py View on Github external
self.source_mask = self.cache.get_source_mask()
                self.target_mask = self.cache.get_target_mask()
            else:
                print("Loading voxel data, might take a few minutes.")
                # load from standard cache
                (
                    self.voxel_array,
                    self.source_mask,
                    self.target_mask,
                ) = self.cache.get_voxel_connectivity_array()

                # save to npy
                save_npy_to_gz(
                    weights_file + ".npy.gz", self.voxel_array.weights
                )
                save_npy_to_gz(nodes_file + ".npy.gz", self.voxel_array.nodes)