Reconstruction module

PyMIALSRTK reconstruction functions.

class pymialsrtk.interfaces.reconstruction.MialsrtkImageReconstruction(*args, **kwargs)[source]

Creates a high resolution image from a set of low resolution images [1]_.

References

[1]Tourbier et al.; NeuroImage, 2015. (link to paper)

Example

>>> from pymialsrtk.interfaces.reconstruction import MialsrtkImageReconstruction
>>> srtkImageReconstruction = MialsrtkTVSuperResolution()
>>> srtkImageReconstruction.inputs.bids_dir = '/my_directory'
>>> srtkImageReconstruction.input_images = ['sub-01_ses-01_run-1_T2w.nii.gz', 'sub-01_ses-01_run-2_T2w.nii.gz',     'sub-01_ses-01_run-3_T2w.nii.gz', 'sub-01_ses-01_run-4_T2w.nii.gz']
>>> srtkImageReconstruction.input_masks = ['sub-01_ses-01_run-1_mask.nii.gz', 'sub-01_ses-01_run-2_mask.nii.gz',     'sub-01_ses-01_run-3_mask.nii.gz', 'sub-01_ses-01_run-4_mask.nii.gz']
>>> srtkImageReconstruction.inputs.stacks_order = [3,1,2,4]
>>> srtkImageReconstruction.inputs.sub_ses = 'sub-01_ses-01'
>>> srtkImageReconstruction.inputs.in_roi = 'mask'
>>> srtkImageReconstruction.inputs.in_deltat = 0.01
>>> srtkImageReconstruction.inputs.in_lambda = 0.75
>>> srtkImageReconstruction.run()  # doctest: +SKIP
input_spec

alias of MialsrtkImageReconstructionInputSpec

output_spec

alias of MialsrtkImageReconstructionOutputSpec

class pymialsrtk.interfaces.reconstruction.MialsrtkImageReconstructionInputSpec(*args, **kwargs)[source]

Class used to represent inputs of the MialsrtkImageReconstruction interface.

bids_dir <string>

BIDS root directory (required)

input_images <list<string>>

Input image filenames (required)

input_masks <list<string>>

Mask of the input images (required)

in_roi <enum>
Define region of interest (required):
  • ‘box’: Use intersections for roi calculation
  • ‘mask’: Use masks for roi calculation
  • ‘all’: Use the whole image FOV
input_rad_dilatation <float>

Radius dilatation used in prior step to construct output filename. (default is 1.0)

sub_ses <string>

Subject and session BIDS identifier to construct output filename.

out_sdi_postfix <string>

suffix added to construct output scattered data interpolation filename (default is ‘_SDI’)

out_transf_postfix <string>

suffix added to construct output transformation filenames (default is ‘_transform’)

stacks_order <list<int>>

List of stack run-id that specify the order of the stacks

See also

pymialsrtk.interfaces.preprocess.MialsrtkImageReconstruction

class pymialsrtk.interfaces.reconstruction.MialsrtkImageReconstructionOutputSpec(*args, **kwargs)[source]

Class used to represent outputs of the MialsrtkImageReconstruction interface.

output_sdi <string>

Output scattered data interpolation image file

output_transforms <string>

Output transformation files

See also

pymialsrtk.interfaces.preprocess.MialsrtkImageReconstruction

class pymialsrtk.interfaces.reconstruction.MialsrtkTVSuperResolution(*args, **kwargs)[source]

Apply super-resolution algorithm using one or multiple input images [1]_.

References

[1]Tourbier et al.; NeuroImage, 2015. (link to paper)

Example

>>> from pymialsrtk.interfaces.reconstruction import MialsrtkTVSuperResolution
>>> srtkTVSuperResolution = MialsrtkTVSuperResolution()
>>> srtkTVSuperResolution.inputs.bids_dir = '/my_directory'
>>> srtkTVSuperResolution.input_images = ['sub-01_ses-01_run-1_T2w.nii.gz', 'sub-01_ses-01_run-2_T2w.nii.gz',     'sub-01_ses-01_run-3_T2w.nii.gz', 'sub-01_ses-01_run-4_T2w.nii.gz']
>>> srtkTVSuperResolution.input_masks = ['sub-01_ses-01_run-1_mask.nii.gz', 'sub-01_ses-01_run-2_mask.nii.gz',     'sub-01_ses-01_run-3_mask.nii.gz', 'sub-01_ses-01_run-4_mask.nii.gz']
>>> srtkTVSuperResolution.input_transforms = ['sub-01_ses-01_run-1_transform.txt', 'sub-01_ses-01_run-2_transform.txt',     'sub-01_ses-01_run-3_transform.txt', 'sub-01_ses-01_run-4_transform.txt']
>>> srtkTVSuperResolution.input_sdi = 'sdi.nii.gz'
>>> srtkTVSuperResolution.inputs.stacks_order = [3,1,2,4]
>>> srtkTVSuperResolution.inputs.sub_ses = 'sub-01_ses-01'
>>> srtkTVSuperResolution.inputs.in_loop = 10
>>> srtkTVSuperResolution.inputs.in_deltat = 0.01
>>> srtkTVSuperResolution.inputs.in_lambda = 0.75
>>> srtkTVSuperResolution.run()  # doctest: +SKIP
input_spec

alias of MialsrtkTVSuperResolutionInputSpec

output_spec

alias of MialsrtkTVSuperResolutionOutputSpec

class pymialsrtk.interfaces.reconstruction.MialsrtkTVSuperResolutionInputSpec(*args, **kwargs)[source]

Class used to represent inputs of the MialsrtkTVSuperResolution interface.

bids_dir <string>

BIDS root directory (required)

input_images <list<string>>

Input image filenames (required)

input_masks <list<string>>

Mask of the input images (required)

input_transforms <list<string>>

Input transformation filenames (required)

input_sdi <string>

Reconstructed image for initialization. Typically the output of MialsrtkImageReconstruction is used. (required)

deblurring <bool>

Flag to set deblurring PSF during SR (double the neighborhood) (default is 0).

in_loop <int>

Number of loops (SR/denoising) (required)

in_deltat <float>

Parameter deltat (required)

in_lambda <float>

Regularization factor (required)

in_bregman_loop <int>

Number of Bregman loops (default is 1)

in_iter <int>

Number of inner iterations (default is 50)

in_step_scale <float>

Parameter step scale (default is 10.0)

in_gamma <float>

Parameter gamma (default is 10.0)

in_inner_thresh <float>

Inner loop convergence threshold (default = 1e-5)

in_outer_thresh <float>

Outer loop convergence threshold (default = 1e-6)

out_prefix <string>

prefix added to construct output super-resolution filename (default is ‘SRTV_’)

stacks_order <list<int>>

List of stack run-id that specify the order of the stacks

input_rad_dilatation <float>

Radius dilatation used in prior step to construct output filename. (default is 1.0)

sub_ses <string>

Subject and session BIDS identifier to construct output filename.

See also

pymialsrtk.interfaces.preprocess.MialsrtkTVSuperResolution

class pymialsrtk.interfaces.reconstruction.MialsrtkTVSuperResolutionOutputSpec(*args, **kwargs)[source]

Class used to represent outputs of the MialsrtkTVSuperResolution interface.

output_sr <string>

Output super-resolution reconstruction file

output_dict <dict>

Super-resolution reconstruction parameters summarized in a python dictionary

output_json <string>

Emplacement where should be saved <output_dict>

See also

pymialsrtk.interfaces.preprocess.MialsrtkTVSuperResolution