Resample3D¶
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 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 ensure 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, it rounds up to the next whole number. The resulting image will therefore have a larger physical size, as the 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,
Resample3Dis not suited. In this case, theReformatcan be used, which allows for reformatting and resampling an image to an arbitrary image geometry. However, it does not provide as many different filters and has a different border handling.
Windows¶
Default Panel¶
Input Fields¶
input0¶
- name: input0, type: Image¶
Input image.
input1¶
- name: input1, type: Image¶
Optional reference image. Must have the same orientation as the input image!
Output Fields¶
output0¶
- name: output0, type: Image¶
Resampled output image.
Parameter Fields¶
Field Index¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Visible Fields¶
Keep Constant¶
- name: keep, type: Enum, default: Scale factor¶
Defines which property should be kept 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 mainly depends on the filter’s support, i.e., the number of neighboring image elements (in 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 |
================ ======================================================= Support: 0.0 No filtering - does not change the image spectrum, i.e.,
|
Triangle/Linear |
Triangle/Linear |
================ ==================================================================== Support: 1.0 Fast but not very high quality.
|
Hermite |
Hermite |
================ ========================================== Support: 1.0 f(t) = 2|t|3 - 3|t|2 + 1 ================ ========================================== |
Blackman |
Blackman |
================ ====================================================================================== Support: 1.0 f(t) = 0.42 + 0.5 * cos(π * t) + 0.08 * cos(2.0 * π * t) ================ ====================================================================================== |
Hamming |
Hamming |
================ =============================================== Support: 1.0 f(t) = 0.54 + 0.46 * cos(π * t) ================ =============================================== |
Hanning |
Hanning |
================ ============================================= Support: 1.0 f(t) = 0.5 + 0.5 * cos(π * t) ================ ============================================= |
Gaussian |
Gaussian |
================ =========================================== Support: 1.5 Probably not a good interpolation function. ================ =========================================== |
Bell/Quadratic |
Bell/Quadratic |
================ = Support: 1.5 ================ = |
Cubic B-Spline |
Cubic_B-Spline |
================ = Support: 2.0 ================ = |
Catrom |
Catrom |
================ = Support: 2.0 ================ = |
Mitchell et al |
Mitchell_et_al |
================ ========================================================== Support: 2.0 Often used, faster but somewhat smoother than Lanczos_3. ================ ========================================================== |
Trunc Sinc 4 |
Trunc_Sinc_4 |
================ ================ Support: 4.0 Sharpest filter. ================ ================ |
Lanczos 2 |
Lanczos_2 |
================ = Support: 2.0 ================ = |
Lanczos 3 |
Lanczos_3 |
================ ============================================================ Support: 3.0 Provides a good compromise between smoothness and sharpness. ================ ============================================================ |
Lanczos 4 |
Lanczos_4 |
================ = Support: 4.0 ================ = |
Box NNB |
Box_NNB |
================ =============== Support: 0.5 Fastest filter. ================ =============== |
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 Factorfactor. The input data is just passed to the output for the respective dimension.Otherwise, a filtering is only performed if
Scale Factordoes not equal 1.0 for any 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 SizeandVoxel Size.
Image Size¶
- name: imageSize, type: Vector3, default: 0 0 0¶
Sets the output image extent in voxels.
Depends on
Scale FactorandVoxel Size.
Voxel Size¶
- name: voxelSize, type: Vector3, default: 0 0 0¶
Sets the output voxel size in millimeters.
Depends on
Scale FactorandImage 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 the 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 gridto 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 SizeandVoxel Translationwill 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.
Reset¶
- name: reset, type: Trigger¶
When pressed, all parameters are reset to their default values.