EMCqMRI.core.models.dataset.base module
- class EMCqMRI.core.models.dataset.base.DatasetModel(config_object)[source]
Bases:
core.base.base_dataset.DatasetBase class for implementation of datasets :param config_object: Configuration object where following attributes
must be specified:
args.engine.fileExtension ([string])
- get_label(idx)[source]
Abstract function for fetching labels and masks from the data directory.
Need subclass to implement different logics, like Relaxometry, Reconstruction, QSM, etc.
- Parameters
idx ([int]) – Index automatically provided by the DataLoader. It ranges from 0 to len(self.filename_list)-1.
- Raises
NotImplementedError – When the subclass does not override this method.
- Returns
The subclass implementation should return the label, and, if available, a mask. For seemless integration with the framework, label should have shape [N, X, Y, …] and the mask should have shape [1,X,Y, …], where N is the number of channels (e.g. weighted images) and X,Y,… are the image dimensions.
- Return type
(Label [torch.Tensor]), (Mask [torch.Tensor] - optional)
- get_signal(*local_args)[source]
Abstract function for fetching the signal from the data directory.
Need subclass to implement different logics, like Relaxometry, Reconstruction, QSM, etc.
- Parameters
idx ([int]) – Index automatically provided by the DataLoader. It ranges from 0 to len(self.filename_list)-1.
- Raises
NotImplementedError – When the subclass does not override this method.
- Returns
The subclass implementation should return the signal. For seemless integration with the framework, signal should have shape [N, X, Y, …], where N is the number of channels (e.g. weighted images) and X,Y,… are the image dimensions.
- Return type
(Signal [torch.Tensor])