Skip to main content

Resample

The Resample tool changes the voxel dimensions and spacing of volume and mask data. Use resampling to upsample (increase resolution) or downsample (decrease resolution) images for specific processing requirements.

Accessing the Tool​

  1. Navigate to the Image tab in the ribbon.
  2. Click Resample in the Transform section.

Concepts​

TermDescription
UpsamplingIncreasing the number of voxels (smaller voxel size)
DownsamplingDecreasing the number of voxels (larger voxel size)
InterpolationMethod for calculating new voxel values

The same region as 6 by 6 voxels, upsampled to 12 by 12 voxels at half the spacing, and downsampled to 3 by 3 voxels at twice the spacing

Parameters​

Interpolation Method​

Select interpolation methods separately for volumes and masks:

MethodFor volumesFor masks
NearestFast, blocky resultsPreserves label values exactly
LinearSmooth gradientsIntroduces intermediate values that are not valid labels
CubicSmoothest resultsNot suitable for masks

The defaults are Linear for volumes and Nearest for masks, which is the right pairing for most work.

Voxel values along a line and the curve each interpolation gives between them: nearest as steps, linear as straight segments, cubic as a smooth curve

tip

Keep Nearest for masks. Any other method blends neighbouring labels and produces values that belong to no label, which turns a clean segmentation into a fringe of invalid voxels along every boundary.

Resampling Method​

Choose the method to define target resolution:

MethodDescription
Voxel dimensions (pixels)Specify the target number of voxels in each direction
Pixel spacing (mm)Specify the target voxel size in millimetres

Only the parameter group belonging to the selected method is shown.

Parameters (pixels)​

ParameterDescription
XTarget number of voxels along X
YTarget number of voxels along Y
ZTarget number of voxels along Z

Parameters (mm)​

ParameterDescription
XTarget voxel size along X
YTarget voxel size along Y
ZTarget voxel size along Z

Information​

The Information group updates as you type, so the effect of a change is visible before you apply it:

RowDescription
Input physical dimensions (mm)Size of the volume before resampling
Output physical dimensions (mm)Size after resampling
Input pixel spacing (mm)Voxel size before resampling
Output pixel spacing (mm)Voxel size after resampling
Input voxel dimensions (pixels)Voxel counts before resampling
Output voxel dimensions (pixels)Voxel counts after resampling

The physical dimensions stay effectively the same through a resample: what changes is how many voxels cover that same physical space, and therefore how large each voxel is.

Workflow​

  1. Open the Resample tool from the Image tab.
  2. Select the resample method (Voxel dimensions (pixels) or Pixel spacing (mm)).
  3. Choose interpolation methods for volumes and masks.
  4. Enter target dimensions or spacing values.
  5. Review the information display to verify the resampling effect.
  6. Click Apply to resample the data.

Use Cases​

Reducing Memory Usage​

Downsample large datasets for:

  • Faster visualization and interaction
  • Reduced processing time for preliminary analysis
  • Lower memory consumption

Matching Resolution Between Datasets​

Align resolution when combining datasets:

  1. Identify the target resolution (usually the coarser dataset).
  2. Resample finer datasets to match.
  3. Enables direct comparison and fusion.

Preparing for Specific Algorithms​

Some processing algorithms require specific resolutions:

  • Neural network inputs may expect fixed dimensions
  • Simulation meshes may have element size requirements
  • Resample to meet these requirements

Isotropic Resampling​

Convert anisotropic data (different spacing in each axis) to isotropic:

  1. Note the smallest spacing value.
  2. Set all three spacing values to this minimum.
  3. Results in cubic voxels for uniform analysis.

Affected Objects​

Resampling affects:

  • All volume objects
  • All mask objects

All datasets are resampled to the same grid to maintain spatial alignment.

Quality Considerations​

Upsampling Limitations​

info

Upsampling cannot recover detail that doesn't exist in the original data. Interpolation creates smooth transitions but does not add real information.

Downsampling Information Loss​

warning

Downsampling permanently reduces detail. High-frequency features and fine structures may be lost. Consider keeping the original data if full resolution may be needed later.

Memory Impact​

Resampling significantly affects memory usage:

Memory ratio=Xnew×Ynew×ZnewXold×Yold×Zold\text{Memory ratio} = \frac{X_{new} \times Y_{new} \times Z_{new}}{X_{old} \times Y_{old} \times Z_{old}}

Example: Doubling resolution in all dimensions increases memory by 8×.

Scripting​

This operation is available via the Python scripting API using resample().

import ScriptingApi as api

app = api.Application()
volume_operations = app.get_volume_operations()

volume_operations.resample(
["Volume1"],
[256, 256, 128], # Target dimensions [x, y, z]
[0.5, 0.5, 1.0], # Target spacing [x, y, z] in mm
api.Interpolation.Linear, # Volume interpolation: Nearest, Linear, or Cubic
api.Interpolation.Nearest # Mask interpolation: Nearest recommended for masks
)

See the VolumeOperations API Reference for details.