pre_processing.py 🚧¢

Source: LION/data_loaders/LUNA16/pre_processing.py

Warning

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

class Nodule(string)

Represents a lung nodule.

…

Attributes β€”β€”β€”- filename : str filename of the original file where the nodule is from loc : np.array location of the nodule in the image diameter: float diameter of the nodule

class LunaImage(folder: pathlib.Path, file)

No docstring is available.

LunaImage.load_data(self)

Overloaded data loader, only to be able to do unit coversion if self.unit has changed, as CTimage does not know what is the expected/desired unit

LunaImage.unload_data(self)

No docstring is available.

LunaImage.set_nodule_data(self, nodule_list)

Sets data about Nodules present in this image

LunaImage.get_croped_nodule_slices(self, indices)

removes all slices from self.data that contain no tumour, given a nodule index It does not free the memory, it only returns the cropped data.

Returns β€”β€” cropped : np.array cropped image with only slices that contain tumours. Its only z-copping, individual slices are left untouched mask : np.array cropped mask with only slices that contain tumours. Its only z-copping, individual slices are left untouched

LunaImage.get_nodule(self, nodule)

returns a cropped nodule, given we know its radious

LunaImage.make_nodule_only_mask(self, indices)

Makes a mask where all the image, except the area where the tumour is, is zeroed.

LunaImage.make_binary_mask_nodule(self, indices)

# DO NOT USE, NOT RELIABLE, OTSU MAY FAIL Given a Nodule indices, segment the nodule, make a binary mask. This uses Otsu and morphological operations, and its quite flimsy at doing its job. Needs work .

class LUNA16(folder: pathlib.Path, verbose=True, load_metadata=False)

Contains the information of the LUNA16 dataset and allows for data loading/processing …

Attributes β€”β€”β€”-

LUNA16.find_subfolders(self, folder: pathlib.Path)

Searches LUNA16 dataset for folders with data

LUNA16.load_metadata(self)

Loads metadata (but not image data) of LUNA16

LUNA16.load_nodule_metadata(self, folder=None)

Loads the metadata of the LUNA16 nodule dataset and assigns it to the relevant image