ct_segnet/data_utils/data_io.py
def est_chunking(self): # Determine the chunk shape for hdf5 file, optimized for slicing along all 3 axes
        """Determines the chunks attribute in hdf5 file based on one of two methods:
        chunked_slice_size : in GB - size of a chunk of some slices along an axis
        chunk_size         : in GB - size of a hyperslab of shape proportional to data shape
        """
        
        if self.tiff_mode:
            self.chunked_shape = None
        else:
            if self.chunk_shape is not None:
                return # allow user to define chunk_shape
            if self.chunk_size is not None:
                fac = np.cbrt((self.chunk_size) / (self.d_size_GB))
                self.chunk_shape = tuple([int(self.d_shape[i]*fac) for i in range(3)])
                return
            if self.chunked_slice_size is not None:
                if self.chunked_slice_size > (self.slice_size[0]*self.d_shape[0]):
                    raise ValueError("chunked_slice_size cannot be larger than dataset size")
                self.chunk_shape = tuple(int(np.ceil(self.chunked_slice_size / single_slice_size)) for single_slice_size in self.slice_size)
                _message("Estimated Chunk shape: %s"%str(self.chunk_shape), self.VERBOSITY > 1)
                return
            else:
                self.chunk_shape = None
                return
        return
Determines the chunks attribute in hdf5 file based on one of two methods:
        chunked_slice_size : in GB - size of a chunk of some slices along an axis
        chunk_size         : in GB - size of a hyperslab of shape proportional to data shape
        
Determines the chunks attribute in hdf5 file based on one of two methods:
chunked_slice_size : in GB - size of a chunk of some slices along an axis
chunk_size         : in GB - size of a hyperslab of shape proportional to data shape
Determines the chunks attribute in hdf5 file based on one of two methods : chunked_slice_size : in GB - size of a chunk of some slices along an axis chunk_size : in GB - size of a hyperslab of shape proportional to data shape
def est_chunking(self): 
        if self.tiff_mode:
            self.chunked_shape = None
        else:
            if self.chunk_shape is not None:
                return 
            if self.chunk_size is not None:
                fac = np.cbrt((self.chunk_size) / (self.d_size_GB))
                self.chunk_shape = tuple([int(self.d_shape[i]*fac) for i in range(3)])
                return
            if self.chunked_slice_size is not None:
                if self.chunked_slice_size > (self.slice_size[0]*self.d_shape[0]):
                    raise ValueError("chunked_slice_size cannot be larger than dataset size")
                self.chunk_shape = tuple(int(np.ceil(self.chunked_slice_size / single_slice_size)) for single_slice_size in self.slice_size)
                _message("Estimated Chunk shape: %s"%str(self.chunk_shape), self.VERBOSITY > 1)
                return
            else:
                self.chunk_shape = None
                return
        return
def est_chunking ( self ) : if self . tiff_mode : self . chunked_shape = None else : if self . chunk_shape is not None : return if self . chunk_size is not None : fac = np . cbrt ( ( self . chunk_size ) / ( self . d_size_GB ) ) self . chunk_shape = tuple ( [ int ( self . d_shape [ i ] * fac ) for i in range ( 3 ) ] ) return if self . chunked_slice_size is not None : if self . chunked_slice_size > ( self . slice_size [ 0 ] * self . d_shape [ 0 ] ) : raise ValueError ( "chunked_slice_size cannot be larger than dataset size" ) self . chunk_shape = tuple ( int ( np . ceil ( self . chunked_slice_size / single_slice_size ) ) for single_slice_size in self . slice_size ) _message ( "Estimated Chunk shape: %s" % str ( self . chunk_shape ) , self . VERBOSITY > 1 ) return else : self . chunk_shape = None return return
Determines the chunks attribute in hdf5 file based on one of two methods:
chunked_slice_size : in GB - size of a chunk of some slices along an axis
chunk_size         : in GB - size of a hyperslab of shape proportional to data shape
Determines the chunks attribute in hdf5 file based on one of two methods : chunked_slice_size : in GB - size of a chunk of some slices along an axis chunk_size : in GB - size of a hyperslab of shape proportional to data shape
# Determine the chunk shape for hdf5 file, optimized for slicing along all 3 axes """Determines the chunks attribute in hdf5 file based on one of two methods:
        chunked_slice_size : in GB - size of a chunk of some slices along an axis
        chunk_size         : in GB - size of a hyperslab of shape proportional to data shape
        """ # allow user to define chunk_shape
self