Page MenuHomePhabricator

Implement ITK class for generating 3D images defined by multiple Gauss functions
Closed, ResolvedPublic

Description

A new class shall be created which can generate a (3D) image, using multiple stacked Gauss functions to define pixel intensities. The purpose of this class is to create test images for testing of the statistics module. By using 3D Gauss functions, an image resembling typical PET scans can be created.

The class should also allow to calculate the "hot spot" of the generated image, i.e. a spheric region of a defined size in the image which has the maximum mean value.

Event Timeline

New remote branch pushed: bug-16396-gaussian-image-generator-for-hotspots

I just rebased the code onto a different branching point in order to make it merge easier with the changes of T16236.

The class name is MultiGaussianImageSource and can be found in the directory MINT\Mint_Bin\CMakeExternals\Source\MITK\Modules\ImageStatistics.
This class generates a image, which pixel intensities are the values of a multigauss function (a sum of 3D gauss functions). The class allows calculating a spherical region of defined size which has a maximal mean value and returns the position and the mean value. Furthermore it can calculate the maximal und minimal pixel intensities and whose indices in the founded sphere.
The test programm (mitkMultiGaussianTest.cpp) creates a .xml file with the following information:

  • image size and number of gauss functions
  • a description of each gauss function: the expectancy value in three axis, the deviation in three axis and the altitude
  • a region of interest ( here equal to the whole image )
  • statistic, i.e. hot spot value (peak and peakOptimized) and its coordinates; maximum and minimum value and whose coordinates.

This test program has an 14 inputs:

  • output filename
  • number of images to be generate
  • image size ( in three coordinates)
  • number of gaussians to be generate
  • minimal/maximal daviation for one gauss function
  • minimal/maximal altitude for one gauss function
  • image spacing ( in three coordinates).

The input list could be extended, for example with a variable region of interest or a min/max expectancy value (here is the min/max expectancy value equal the size of the image +/- 7).

The class name is MultiGaussianImageSource and can be found in the directory MINT\Mint_Bin\CMakeExternals\Source\MITK\Modules\ImageStatistics.
This class generates a image, which pixel intensities are the values of a multigauss function (a sum of 3D gauss functions). The class allows calculating a spherical region of defined size which has a maximal mean value and returns the position and the mean value. Furthermore it can calculate the maximal und minimal pixel intensities and whose indices in the founded sphere.
The test programm (mitkMultiGaussianTest.cpp) creates a .xml file with the following information:

  • image size and number of gauss functions
  • a description of each gauss function: the expectancy value in three axis, the deviation in three axis and the altitude
  • a region of interest ( here equal to the whole image )
  • statistic, i.e. hot spot value (peak and peakOptimized) and its coordinates; maximum and minimum value and whose coordinates.

This test program has an 14 inputs:

  • output filename
  • number of images to be generate
  • image size ( in three coordinates)
  • number of gaussians to be generate
  • minimal/maximal daviation for one gauss function
  • minimal/maximal altitude for one gauss function
  • image spacing ( in three coordinates).

The input list could be extended, for example with a variable region of interest or a min/max expectancy value (here is the min/max expectancy value equal the size of the image +/- 7).

Added a subdivision of the sphere in cuboids wiht octrees to calculate analytical the integral over gaussian with the value tabel of the normal distribution (http://www.stat.tamu.edu/~lzhou/stat302/standardnormaltable.pdf).
We needed a cuboid because the antiderivativ can not be given in an explicit way and therefore we are not able to subsitude in the integral with spherical coordinates.

Added a pinput parameter entireHotSpotInImage, which determines whether the whole sphere is in the image included ( = 1 ) or only the midpoint of the sphere is inside the image.

NOTE: When the entireHotSpotInImage = 0 it is possible that we find the midpoint of the sphere on the border of the image. In this case we cut the approximation of the sphere, so that we become a body, which is completely inside the image, but not a "sphere" anymore. To that effect is the volume of the body decreased and that could lead to unexpected results. Added a new input parameter numberOfLabels to determine the number of regions of interest (ROI). In each ROI we find the sphere with the wanted properties and midpoint inside the ROI, but not necessarily the whole sphere. Adjusted spacing to be variable in each direction. NOTE: The origin of the image should always be placed by the coordinate [0.0, 0.0, 0.0]. An Example for the input .xml file: -----------INPUT------------------- <testcase> <testimage image-rows="20" image-columns="20" image-slices="20" numberOfGaussians="2" spacingX="1" spacingY="1" spacingZ="1" entireHotSpotInImage="1"> <gaussian centerIndexX="4" centerIndexY="16" centerIndexZ="10" deviationX="7" deviationY="7" deviationZ="7" altitude="200"/> <gaussian centerIndexX="18" centerIndexY="2" centerIndexZ="10" deviationX="1" deviationY="1" deviationZ="1" altitude="210"/> </testimage> <segmentation numberOfLabels="1" hotspotRadiusInMM="6.2035"> <roi label="1" maximumSizeX="20" minimumSizeX="0" maximumSizeY="20" minimumSizeY="0" maximumSizeZ="20" minimumSizeZ="0"/> </segmentation> </testcase> ----------------------------------

For generating the gaussian image change the way we calculate the value in each voxel:
instead of taking the value at the voxel's midpoint we calculate the mean value in the voxel with an integral of the gaussians over the voxel's boundary.