Purpose

The module SubImageStatistics computes statistics of the input image voxels.

Statistics are calculated along the dimensions selected by the user. The default is a computation along the x-, y-, and z-axes. The results are returned in the output image, where the first dimension along which statistics were computed contains the various statistical values, all other dimensions are reduced to length one, and the remaining dimensions remain unchanged. Which values are returned can be controlled through the emit… fields.

A subset of voxels can be selected by providing an interval of gray values. Voxels with values outside this interval are ignored if this feature is activated.

A subset can also be defined by providing a mask image as the second input to this module. Voxels will only be considered if the mask image at this position contains a non-zero value (if the image has an integer type) or a value greater than zero (if the image has a floating-point type).

It is also possible to use multiple regions in one mask image by assigning each region its own value in the mask. The statistics will be gathered per region if Use Mask Id is set to true. The maximum number of regions should be specified by the Max Mask Ids field (if it is set to 1, only the first region is output; if it is set to 2, the statistics for the first two regions are output, etc.).

The mask does not need to have the same size as the data image; everything outside the mask image area is treated as if the mask were zero. However, special handling occurs if the mask has a size of one in any direction: in this case, the mask is replicated along these axes to infinity.

If you do not want this behavior, adjust the mask image size to match the data image size using an SubImage module before connecting it to SubImageStatistics (or at least to size 2 in the affected dimension).

There is a read-only field that indicates whether a valid image mask is connected to the second input. If this field is unchecked, the mask is not considered, even if an image is connected (e.g., because it is invalid).

If both a mask image and a gray value interval are specified, both are combined; that is, only voxels where the mask is set and whose gray values lie within the interval are considered.

Windows

Default Panel

../../../Modules/ML/MLMiscModules/mhelp/Images/Screenshots/SubImageStatistics._default.png

Input Fields

input0

name: input0, type: Image

input1

name: input1, type: Image

Output Fields

output0

name: output0, type: Image

Parameter Fields

Visible Fields

Minimum Voxel Value

name: minValue, type: Double, default: -1000

Sets the lower interval bound.

Maximum Voxel Value

name: maxValue, type: Double, default: 1000

Sets the upper interval bound.

Only consider voxels in interval

name: useInterval, type: Bool, default: FALSE

If checked, only voxel with a value in the interval specified by Minimum Voxel Value and Maximum Voxel Value are investigated.

Fold X axis

name: foldXDim, type: Bool, default: TRUE

If checked, the statistics are applied along the x-axis.

Fold Y axis

name: foldYDim, type: Bool, default: TRUE

If checked, the statistics are applied along the y-axis.

Fold Z axis

name: foldZDim, type: Bool, default: TRUE

If checked, the statistics are applied along the z-axis.

Fold C axis

name: foldCDim, type: Bool, default: FALSE

If checked, the statistics are applied along the c-axis.

Fold T axis

name: foldTDim, type: Bool, default: FALSE

If checked, the statistics are applied along the t-axis.

Fold U axis

name: foldUDim, type: Bool, default: FALSE

If checked, the statistics are applied along the u-axis.

Emit average

name: emitAverage, type: Bool, default: TRUE

If checked, the average value is set to the first dimension of the output image.

Emit std.dev.

name: emitStdDev, type: Bool, default: TRUE

If checked, the standard deviation is set to the second dimension of the output image.

Emit minimum

name: emitMinimum, type: Bool, default: TRUE

If checked, the minimum value is set to the third dimension of the output image.

Emit maximum

name: emitMaximum, type: Bool, default: TRUE

If checked, the maximum value is set to the fourth dimension of the output image.

Emit voxel count

name: emitCount, type: Bool, default: TRUE

If checked, the number of voxels is set to the fifth dimension of the output image.

Use Mask Id

name: useMaskId, type: Bool, default: FALSE

If checked, statistics are computed for each separate region in the mask.

Each region has its own (non-zero) voxel value in the mask. The resulting statistics are output per region for as many regions as are available, up to a maximum of Max Mask Ids. If Max Mask Ids is larger than the number of regions, the remaining statistics are filled with zeros.

The order of the output is as follows: first all statistics of the first region, then all statistics of the second region, and so on. The regions themselves are ordered based on the numerical value of the mask voxels, with the lowest voxel values first.

Max Mask Ids

name: maxMaskIds, type: Integer, default: 1

Sets the maximum number of regions for which statistics are output.

Mask image is valid and used

name: maskIsValid, type: Bool, persistent: no

Shows whether the attached mask image is valid and used.

Auto apply

name: autoApply, type: Bool, default: TRUE

If checked, the module updates the output image on any parameter change.

Otherwise, the output is invalidated on any parameter change and the user needs to press Update to update the output.

Auto update

name: autoUpdate, type: Bool, default: TRUE

If checked, the module updates the output image on any input image change.

Otherwise, the output is invalidated on any input image change and the user needs to press Update to update the output.

Update

name: update, type: Trigger, deprecated name: apply

When pressed, the module updates its output image.

Hidden Fields

outputIsValid

name: outputIsValid, type: Bool, persistent: no

Shows whether the output image is valid.