CorpusCallosum.transforms.segmentation

class CorpusCallosum.transforms.segmentation.CropAroundACPC(*args, **kwargs)[source]

Crop image around anterior and posterior commissure points.

A transform that crops the input image around the AC and PC points with optional padding and random translation.

Parameters:
keyslist[str]

Keys of the data dictionary to apply the transform to.

allow_missing_keysbool, default=False

Whether to allow missing keys in the data dictionary.

padding_mmfloat, default=10.0

Padding around AC-PC region in millimeters.

random_translatefloat, default=0

Maximum random translation in voxels, off by default.

Methods

__call__(data)

Apply the transform to the data.

call_update(data)

This function is to be called after every self.__call__(data), update data[key_transforms] and data[key_meta_dict] using the content from MetaTensor data[key], for MetaTensor backward compatibility 0.9.0.

first_key(data)

Get the first available key of self.keys in the input data dictionary.

key_iterator(data, *extra_iterables)

Iterate across keys and optionally extra iterables.

randomize(data)

Within this method, self.R should be used, instead of np.random, to introduce random factors.

set_random_state([seed, state])

Set the random state locally, to control the randomness, the derived classes should use self.R instead of np.random to introduce random factors.

Notes

The transform expects the following keys in the data dictionary:

  • AC_centernp.ndarray

    Coordinates of anterior commissure

  • PC_centernp.ndarray

    Coordinates of posterior commissure

  • resfloat

    Voxel resolution in mm

class CorpusCallosum.transforms.segmentation.CropAroundACPCtrack(*args, **kwargs)[source]

Crop image around AC-PC points and update their coordinates.

Extends CropAroundACPC to also adjust the AC and PC center coordinates after cropping to maintain their correct positions in the cropped image.

Parameters:
keyslist[str]

Keys of the data dictionary to apply the transform to.

allow_missing_keysbool, optional

Whether to allow missing keys in the data dictionary, by default False.

padding_mmfloat, optional

Padding around AC-PC region in millimeters, by default 10.

random_translatefloat, optional

Maximum random translation in voxels, by default 0.

Methods

__call__(data)

Apply the transform to the data.

call_update(data)

This function is to be called after every self.__call__(data), update data[key_transforms] and data[key_meta_dict] using the content from MetaTensor data[key], for MetaTensor backward compatibility 0.9.0.

first_key(data)

Get the first available key of self.keys in the input data dictionary.

key_iterator(data, *extra_iterables)

Iterate across keys and optionally extra iterables.

randomize(data)

Within this method, self.R should be used, instead of np.random, to introduce random factors.

set_random_state([seed, state])

Set the random state locally, to control the randomness, the derived classes should use self.R instead of np.random to introduce random factors.

Notes

The transform expects the following keys in the data dictionary:

  • AC_centernp.ndarray

    Coordinates of anterior commissure

  • PC_centernp.ndarray

    Coordinates of posterior commissure

  • AC_center_originalnp.ndarray

    Original coordinates of anterior commissure

  • PC_center_originalnp.ndarray

    Original coordinates of posterior commissure