icometrix / dicom2nifti

MIT License
339 stars 79 forks source link

Missing documentation for padding #90

Open cl445 opened 3 years ago

cl445 commented 3 years ago

I do not get what padding is exactly doing. How is the connection to the parameter?

abrys commented 3 years ago

The padding is a resample padding value (terminology borrowed from niftyreg).

When resampling a non orthogonal image to an orthogonal image (for example gantry tilted ct image) there are voxels in the destination image that do not have a corresponding voxel(s) in the source image. At the borders/corners of the destination image. These need to get a value and for this we use the padding value provided.

For example on an average MR image the background value would be 0 so it is advisable to resample using the padding value 0. However for CT the background value will be -1000 so there it would be best to use -1000.

To be short the padding is only used if resampling is enabled (for gantry tilt or inconsistent slice increment) and should in general be set to the background value of the image.

Some examples can be found here https://icometrix.github.io/dicom2nifti/readme.html#command-line

cl445 commented 3 years ago

Thank you, that helped a lot!