=[1,1,1], reorder=True)
MedBase.item_preprocessing(resample= MedImage.create('images/IXI002-Guys-0828-T1.nii.gz')
im type(im), MedImage) test_eq(
Vision core
Load images
med_img_reader
med_img_reader (file_path:str|pathlib.Path|fastcore.foundation.L|list, reorder:bool=False, resample:list=None, only_tensor:bool=True, dtype=<class 'torch.Tensor'>)
*Loads and preprocesses a medical image.
Args: file_path: Path to the image. Can be a string, Path object or a list. reorder: Whether to reorder the data to be closest to canonical (RAS+) orientation. Defaults to False. resample: Whether to resample image to different voxel sizes and image dimensions. Defaults to None. only_tensor: Whether to return only image tensor. Defaults to True. dtype: Datatype for the return value. Defaults to torch.Tensor.
Returns: The preprocessed image. Returns only the image tensor if only_tensor is True, otherwise returns original image, preprocessed image, and original size.*
MetaResolver
MetaResolver (*args, **kwargs)
*A class to bypass metaclass conflict: https://pytorch-geometric.readthedocs.io/en/latest/_modules/torch_geometric/data/batch.html*
MedBase
MedBase (*args, **kwargs)
A class that represents an image object. Metaclass casts x
to this class if it is of type cls._bypass_type
.
MedImage
MedImage (*args, **kwargs)
Subclass of MedBase that represents an image object.
MedMask
MedMask (*args, **kwargs)
Subclass of MedBase that represents an mask object.
setup_vscode_progress
setup_vscode_progress ()
Configure fastai to use VS Code-compatible progress callback.
VSCodeProgressCallback
VSCodeProgressCallback (**kwargs)
Enhanced progress callback that works better in VS Code notebooks.
= im.show(anatomical_plane=0) ax