dosma.register
- dosma.register(target: Union[dosma.core.med_volume.MedicalVolume, str], moving: Union[dosma.core.med_volume.MedicalVolume, str, Sequence[Union[dosma.core.med_volume.MedicalVolume, str]]], parameters: Union[str, Sequence[str]], output_path: str, target_mask: Optional[Union[dosma.core.med_volume.MedicalVolume, str]] = None, moving_masks: Optional[Union[dosma.core.med_volume.MedicalVolume, str, Sequence[Union[dosma.core.med_volume.MedicalVolume, str]]]] = None, sequential: bool = False, collate: bool = True, num_workers: int = 0, num_threads: int = 1, show_pbar: bool = False, return_volumes: bool = False, rtype: type = <class 'dict'>, **kwargs)[source]
Register moving image(s) to the target.
MedVolOrPathis a shorthand forUnion[MedicalVolume, str, Path]. It indicates the argument can be either aMedicalVolumeor a path to a nifti file.- Parameters
target (MedicalVolume or str) – The target/fixed image.
moving (MedicalVolume(s) or str(s)) – The moving/source image(s).
parameters (str(s)) – Elastix parameter files to use.
output_path (str) – Output directory to store files.
target_mask (MedicalVolume or str, optional) – The target/fixed mask.
moving_masks (MedicalVolume(s) or str(s), optional) – The moving mask(s). If only one specified, the mask will be used for all moving images.
sequential (bool, optional) – If True, apply parameter files sequentially.
collate (bool, optional) – If True, will collate outputs from sequential registration into single RegistrationOutputSpec instance. If sequential=False, this argument is ignored.
num_workers (int, optional) – Number of workers to use for reading and writing data and for registration.
num_threads (int, optional) – Number of threads to use for registration. Note total number of threads used will be
num_workers * num_threads.show_pbar (bool, optional) – If True, show progress bar during registration. Note the progress bar will not be shown for intermediate reading/writing.
return_volumes (bool, optional) – If True, registered volumes will also be returned. By default, only the output namespaces (RegistrationOutputSpec) of the registrations are returned.
rtype (type, optional) – The return type. Either dict or tuple.
kwargs – Keyword arguments used to initialize nipype.interfaces.elastix.Registration.
- Returns
Type specified by
rtype. Ifrtype=dict, returns dict with keys'outputs'and'volumes'(ifreturn_volumes=True). Ifrtype=tuple, returns(outputs, volumes or None). Length ofoutputsandvolumesdepends on number of images specified inmoving:outputs (Sequence[RegistrationOutputSpec]): The output objects from elastix registration, one for each moving image. Each object is effectively a namespace with four main attributes:
’transform’ (List[str]): Paths to transform files produced using registration.
’warped_file’ (str): Path to the final registered image.
’warped_files’ (List[str]): Paths to all intermediate images created if multiple parameter files used.
volumes (Sequence[MedicalVolume]): Registered volumes.
- Return type
Dict or Tuple