Resample3D¶
-
MLModule
¶ genre Resample
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLGeometry1
definition MLGeometry1.def keywords interpolation
,scale
,zoom
,trilinear
,triquadratic
,tricubic
,hermite
,polynome
,mitchell
,lanczos
,sinc
,gaussian
,filter
Purpose¶
The module Resample3D
resamples an image in 3D on an arbitrary planar parallel grid. NOTE: The orientation of the input image cannot be changed with this module. For that purpose, use the module Reformat
instead.
Usage¶
Use either Image Size
, Voxel Size
, or Scale Factor
to specify the output grid that is used to resample the image data.
Additionally, a Voxel Translation
can be given to perform subvoxel translation of the output grid.
Alternatively, voxel size and voxel translation can be automatically derived from a reference image to make sure the resampled image and the reference image are correctly aligned (with respect to the world/patient coordinate system) after resampling. NOTE: The reference image must have the same orientation as the main input image!
note: | If the resulting image size is fractional, the size will be rounded up to the next whole integer. The resulting image will therefore have a bigger physical size, because the resulting voxel size is not corrected for this. Missing values in the source image will be obtained by replicating the border values of the source image. |
---|
Details¶
Choose one of many Resampling Filter
to be used for the resampling that differ importantly in both support (i.e. the number of input voxel required for the computation of an output voxel) and in smoothness (resp. their edge-preserving property).
The filtering is performed consecutively and separately for all dimensions (x, y, and z).
Tips¶
- Note that Min/Max values are automatically taken over from the input image, even if filtered values would exceed this range. In these cases clamping to the min/max range is performed. This cannot be avoided due to the page-based/demand driven approach this module works with, so the user can only avoid it by changing the properties of the input image accordingly.
- For changing the orientation or the ‘area’ (i.e. the extent or position of the image in patient space) covered by the image,
Resample3D
is not suited. In this case, theReformat
can be used, which allows to reformat and resample an image to an arbitrary image geometry. However, it does not provide as many different filters and has a different border handling.
Input Fields¶
Parameter Fields¶
Field Index¶
Filter always : Bool |
Use isotropic voxel size : Bool |
Filtering Tolerance : Double |
Voxel Size : Vector3 |
Image Size : Vector3 |
Voxel Translation : Vector3 |
Keep Constant : Enum |
|
Resample to reference image grid : Bool |
|
Resampling Filter : Enum |
|
Reset : Trigger |
|
Scale Factor : Vector3 |
Visible Fields¶
Keep Constant¶
-
name:
keep
, type:
Enum
, default:
Scale factor
¶ Defines which property should be held constant if the input image changes.
Values:
Title | Name |
---|---|
Image size | Image size |
Voxel size | Voxel size |
Scale factor | Scale factor |
Resampling Filter¶
-
name:
filter
, type:
Enum
, default:
Lanczos_3
¶ Defines the filter with which the voxel value of the resampled output image is determined.
The computation time is mainly dependent on the filter’s support, i.e. the number of neighboring image elements (to both directions) that are taken into account for the computation of an actual output image element.
Often used filters are Nearest_Neighbor, Triangle/Linear, Mitchell_et_al, and Lanczos_3.
Values:
Title | Name | Description | ||
---|---|---|---|---|
Nearest Neighbor | Nearest_Neighbor |
|
||
Triangle/Linear | Triangle/Linear |
|
||
Hermite | Hermite |
|
||
Blackman | Blackman |
|
||
Hamming | Hamming |
|
||
Hanning | Hanning |
|
||
Gaussian | Gaussian |
|
||
Bell/Quadratic | Bell/Quadratic |
|
||
Cubic B-Spline | Cubic_B-Spline |
|
||
Catrom | Catrom |
|
||
Mitchell et al | Mitchell_et_al |
|
||
Trunc Sinc 4 | Trunc_Sinc_4 |
|
||
Lanczos 2 | Lanczos_2 |
|
||
Lanczos 3 | Lanczos_3 |
|
||
Lanczos 4 | Lanczos_4 |
|
||
Box NNB | Box_NNB |
|
Use isotropic voxel size¶
-
name:
isotropic
, type:
Bool
, default:
FALSE
¶ If checked, an isotropic voxel size is obtained at the output (i.e. vx = vy = vz).
Filter always¶
-
name:
filterAlways
, type:
Bool
, default:
FALSE
, deprecated name:
FilterForScale1
¶ If checked, a filtering is always performed, independent of the
Scale Factor
factor. The input data is just passed to the output for the respective dimension.Otherwise, a filtering is only performed if
Scale Factor
does not equal 1.0 for a dimension.
Filtering Tolerance¶
-
name:
filterAlwaysTolerance
, type:
Double
, default:
0
¶ Sets the value threshold difference for shifting where a resampling should be performed.
If this value is set to 0, the filtering is disabled, if set to 1e-6, rounding errors are ignored.
Scale Factor¶
-
name:
zoom
, type:
Vector3
, default:
1 1 1
¶ Sets the scale factor for the output image in comparison to the input image.
A value of 1.0 means identity.
Depends on
Image Size
andVoxel Size
.
Image Size¶
-
name:
imageSize
, type:
Vector3
, default:
0 0 0
¶ Sets the output image extent in voxel.
Depends on
Scale Factor
andVoxel Size
.
Voxel Size¶
-
name:
voxelSize
, type:
Vector3
, default:
0 0 0
¶ Sets the output voxel size in mm.
Depends on
Scale Factor
andImage Size
.
Voxel Translation¶
-
name:
subVoxelShift
, type:
Vector3
, default:
0 0 0
¶ Sets a translation vector for the output image.
For instance, a voxel translation of (-0.5) in x-direction moves the output grid half an input voxel to the left.
Hint: Usually this parameter is used to align the output to a reference grid. Enable
Resample to reference image grid
to let the module determine the shift from the input images automatically.
Resample to reference image grid¶
-
name:
useReferenceImage
, type:
Bool
, default:
FALSE
¶ If checked,
Voxel Size
andVoxel Translation
will be copied from the reference image, making sure the grids of the resampled and of the reference image are correctly aligned (with respect to the world/patient coordinate system) after resampling.Notes: * This option aligns the grids, but not the full images, i.e. there still might be a shift between resampled and reference image by an integer number of voxels. * Also, the module requires the reference image to have the exact same orientation as the main input image.
If an image shall be resampled to exactly the grid and extent of a reference image with arbitrary orientation, try to use the module
Reformat
.