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

Parameters

Interpolation Method

Select interpolation methods separately for volumes and masks:

MethodVolume UseMask Use
NearestFast, blocky resultsPreserves label values
LinearSmooth gradientsMay introduce intermediate values
CubicSmoothest resultsNot recommended for masks
tip

Always use Nearest interpolation for masks to preserve exact label values. Use Linear or Cubic for grayscale volumes.

Resampling Method

Choose the method to define target resolution:

MethodDescription
Voxel dimensionsSpecify the target number of voxels in each direction
Pixel spacingSpecify the target voxel size in millimeters

By Voxel Dimensions

ParameterDescription
X (pixels)Target width in voxels (2-2048)
Y (pixels)Target height in voxels (2-2048)
Z (pixels)Target depth in voxels (2-2048)

By Pixel Spacing

ParameterDescription
X (mm)Target voxel width
Y (mm)Target voxel height
Z (mm)Target voxel depth

Information Display

The tool shows:

  • Current and target dimensions
  • Current and target spacing
  • Physical size (remains constant during resampling)

Workflow

  1. Open the Resample tool from the Image tab.
  2. Select the resampling mode (By Dimensions or By Spacing).
  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.