Purpose

The module SubImageStatistics computes some statistics of the input image voxels.

Statistics are calculated along the dimensions the user selected. Default is computation along the X, Y, and Z axis. The results are returned in the output image where the first dimension along which statistics were computed contains the various statistical values, all other reduced dimensions are one and the remaining dimensions are 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 at the second input to this module. Voxels will only be considered if the mask image at this place contains a non-zero value (if the image has an integer type) or greater than zero (if the image has a floating point type).

It is also possible to use multiple region in one mask image, by giving 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 first two region statistics 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 was zero. But a special handling occurs if the mask has size one in any direction: In this case, the mask is replicated along these axes to infinity.

If you do not want this behavior, bring the mask image size to the data image size with 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 if 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 an mask image and a gray value interval is specified, both are combined, i.e., only voxels where the mask is set and whose gray values lie inside 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

Set this if you want statistics for each separate region in the mask. Each region has its own (non-zero) pixel value in the mask. The resulting statistics are output per region, for as many regions as are available, with 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: first all statistics of the first region, then all statistics of the second region, etc. The regions themselves are ordered based on the (numerical) value of the mask pixels, lowest pixel values first.

Max Mask Ids

name: maxMaskIds, type: Integer, default: 1

Maximum number of regions for which statistics are output.

Mask image is valid and used

name: maskIsValid, type: Bool, persistent: no

Shows if 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. If not checked 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. If not checked 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

If pressed, the module updates its output image.

Hidden Fields

outputIsValid

name: outputIsValid, type: Bool, persistent: no

This field is set to true if the output image is valid.