data_primitives.py 🚧¢

Source: LION/data_loaders/LUNA16/data_primitives.py

Warning

This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.

class CTimage(folder: pathlib.Path, file_path: pathlib.Path, load_data=False)

Container for the images on the CT images from different datasets

…

Attributes β€”β€”β€”- folder : str folder where the data is located

file_name : str file_name of this image

image : np.array pixel image information

offset: np.array (3,1) offset of image center

spacing: np.array (3,1) size of each voxel in mm

dimsize : np.array(3,1) same as image.shape, but of the original data.

shape: tuple same as dimsize but in np.shape compatible format

Methods β€”β€”-

CTimage.load_data(self)

Loads the image information from disk

CTimage.unload_data(self)

Deletes image information (but not metadata)

CTimage.load_metadata(self)

Loads metadata of the image.

CTimage.coords2index(self, coords)

gives indices of real world coordinates for image

CTimage.resample(self, resolution)

Resamples the data (modifying it) and the mask

CTimage.crop_z(self, slices)

Crops the desired slices in Z