Skip to content

Reconstruction

In the super-resolution reconstruction steps, an algorithm will take as input several pre-processed stacks and output a single super-resolution reconstructed volume. This volume can then be used as input in the segmentation step.

Available tools

Several state-of-the-art super-resolution reconstruction algorithms have been wrapped and tested in fetpype.

Algorithm Repository Docker
NiftyMIC1 https://github.com/gift-surg/NiftyMIC https://hub.docker.com/r/renbem/niftymic
SVRTK23 https://github.com/SVRTK/SVRTK https://hub.docker.com/r/fetalsvrtk/svrtk
NeSVoR4 https://github.com/daviddmc/NeSVoR https://hub.docker.com/r/junshenxu/nesvor

Config structure

Here's a typical structure found in the NeSVoR config.

pipeline: "nesvor"
docker: 
  cmd: "docker run --gpus '\"device=0\"' <mount> junshenxu/nesvor:v0.5.0 
    nesvor reconstruct 
    --input-stacks <input_stacks> 
    --stack-masks <input_masks> 
    --output-volume <output_volume> 
    --batch-size 4096 
    --n-levels-bias 1"
singularity:
  cmd: "singularity exec --bind <singularity_mount> --nv <singularity_path>/nesvor.sif 
    nesvor reconstruct 
    --input-stacks <input_stacks> 
    --stack-masks <input_masks> 
    --output-volume <output_volume> 
    --batch-size 4096 
    --n-levels-bias 1"
args:
    path_to_output: "nesvor.nii.gz"

Note

All the container runs use the command above and are passed through the function run_recon_cmd

Tags

There are a limited set of tags that can be used for reconstruction:

Command
Description Comments
<mount> Where the different folders will be mounted on Docker Docker only
<singularity_mount> Where the different folders will be mounted on Singularity Singularity only
<input_stacks> The list of inputs stacks will be given as arguments Mutually exclusive with <input_dir>
<input_dir> The folder that contains the input stacks Mutually exclusive with <input_stacks>
<input_masks> The list of inputs masks will be given as arguments Mutually exclusive with <input_masks_dir>
<input_masks_dir> The folder that contains the input masks Mutually exclusive with <input_masks>
<output_volume> The output volume Mutually exclusive with <output_dir>
<output_dir> The output directory Mutually exclusive with <output_volume>
<input_tp> The through-plane resolution of input stacks Needed for SVRTK - Automatically calculated
<output_res> The desired voxel resolution for the reconstructed volume This tag be set in the config file in the field reconstruction/output_resolution.

Note

The configs contains an additional variable path_to_output. This is needed when only an <output_dir> is given to the method. This variable contains the path where the reconstructed volume will be located relative to <output_dir>.

Postprocessing

After the reconstruction, a postprocessing step is applied. This step is consisted of an intensity clamping and post bias correction.


Reconstruction → Intensity clamping → Post bias correction → Output


  • Intensity clamping: Clamps the image intensity using a threshold defined by a quantile ratio. The value of this ratio is specified in the configuration file as "quantile_ratio".
  • Bias field correction: N4 bias field correction5 similar to the bias correction used in the preprocessing.

Config structure

The config file is structured as follows:

quantile_ratio: 0.997
postprocessing:
  clamp_intensity:
    enabled: true
  bias_correction:
    enabled: true
    docker:
      cmd: "docker run <mount> fetpype/fetpype_utils:latest run_bias_field_correction 
        --input_stacks <input_stacks> 
        --input_masks <input_masks> 
        --output_stacks <output_stacks>"
    singularity:
      cmd: "singularity run --bind <singularity_mount>
        <singularity_path>/fetpype_utils.sif
        run_bias_field_correction
        --input_stacks <input_stacks> 
        --input_masks <input_masks> 
        --output_stacks <output_stacks>"

Note

  • The intensity clamping is passed through the function [clamp_intensities]
  • The container run of bias correction uses the command above and is passed through the function [run_postpro_cmd]

  1. Michael Ebner and others. An automated framework for localization, segmentation and super-resolution reconstruction of fetal brain mri. NeuroImage, 206:116324, 2020. 

  2. Maria Kuklisova-Murgasova and others. Reconstruction of fetal brain MRI with intensity matching and complete outlier removal. Medical image analysis, 16(8):1550–1564, 2012. 

  3. Alena U Uus and others. Automated 3D reconstruction of the fetal thorax in the standard atlas space from motion-corrupted MRI stacks for 21–36 weeks ga range. Medical image analysis, 80:102484, 2022. 

  4. Junshen Xu and others. NeSVoR: implicit neural representation for slice-to-volume reconstruction in MRI. IEEE Transactions on Medical Imaging, 2023. 

  5. Nicholas J Tustison, Brian B Avants, Philip A Cook, Yuanjie Zheng, Alexander Egan, Paul A Yushkevich, and James C Gee. N4ITK: improved n3 bias correction. IEEE transactions on medical imaging, 29(6):1310–1320, 2010.