28 #ifndef __itkMultiGaussianImageSource_h
29 #define __itkMultiGaussianImageSource_h
31 #include "itkImageSource.h"
32 #include "itkNumericTraits.h"
33 #include "itkImageRegionIteratorWithIndex.h"
34 #include "itkImageFileWriter.h"
35 #include <itkMapContainer.h>
193 template<
typename TOutputImage >
213 typedef typename TOutputImage::SizeType
SizeType;
218 typedef SizeValueType SizeValueArrayType[TOutputImage::ImageDimension];
220 typedef SpacingValueType SpacingValueArrayType[TOutputImage::ImageDimension];
222 typedef PointValueType PointValueArrayType[TOutputImage::ImageDimension];
240 itkSetMacro(Size, SizeType);
241 virtual void SetSize(SizeValueArrayType sizeArray);
242 virtual const SizeValueType * GetSize()
const;
244 itkSetMacro(Spacing, SpacingType);
245 virtual void SetSpacing(SpacingValueArrayType spacingArray);
246 virtual const SpacingValueType * GetSpacing()
const;
248 itkSetMacro(Origin, PointType);
249 virtual void SetOrigin(PointValueArrayType originArray);
250 virtual const PointValueType * GetOrigin()
const;
252 virtual unsigned int GetNumberOfGaussians()
const;
254 virtual void SetNumberOfGausssians(
unsigned int );
256 virtual RadiusType GetRadius()
const;
257 virtual void SetRadius( RadiusType radius );
259 virtual const OutputImagePixelType GetMaxMeanValue()
const;
261 virtual const IndexType GetSphereMidpoint()
const;
263 virtual double MultiGaussianFunctionValueAtPoint(
double ,
double,
double);
266 virtual void AddGaussian( VectorType centerX, VectorType centerY, VectorType centerZ, VectorType sigmaX, VectorType sigmaY, VectorType sigmaZ, VectorType altitude);
268 virtual void CalculateTheMidpointAndTheMeanValueWithOctree();
270 virtual void CalculateMaxAndMinInSphere();
272 virtual const IndexType GetMaxValueIndexInSphere()
const;
274 virtual const OutputImagePixelType GetMaxValueInSphere()
const;
276 virtual const IndexType GetMinValueIndexInSphere()
const;
278 virtual const OutputImagePixelType GetMinValueInSphere()
const;
280 virtual void SetRegionOfInterest(ItkVectorType, ItkVectorType);
282 virtual void WriteXMLToTestTheCuboidInsideTheSphere();
284 virtual void CalculateEdgesInSphere( PointType globalCoordinateMidpointCuboid, PointType globalCoordinateMidpointSphere,
double cuboidRadius,
int level);
286 virtual double MultiGaussianFunctionValueAtCuboid(
double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax);
288 virtual void InsertPoints( PointType globalCoordinateMidpointCuboid,
double cuboidRadius);
290 virtual void GenerateCuboidSegmentationInSphere( PointType globalCoordinateMidpointSphere );
292 virtual double FunctionPhi(
double value);
294 virtual unsigned int IntersectTheSphere( PointType globalCoordinateMidpointCuboid, PointType globalCoordinateMidpointSphere,
double sideLength);
296 void SetNormalDistributionValues();
301 itkSetClampMacro(
Min, OutputImagePixelType,
302 NumericTraits< OutputImagePixelType >::NonpositiveMin(),
305 bool IsInImage(IndexType index);
308 itkGetConstMacro(
Min, OutputImagePixelType);
312 itkSetClampMacro(
Max, OutputImagePixelType,
313 NumericTraits< OutputImagePixelType >::NonpositiveMin(),
317 itkGetConstMacro(
Max, OutputImagePixelType);
322 void PrintSelf(std::ostream & os, Indent indent)
const;
324 virtual void GenerateData();
325 virtual void GenerateOutputInformation();
332 SpacingType m_Spacing;
334 OutputImagePixelType m_MaxValueInSphere;
335 IndexType m_MaxValueIndexInSphere;
336 OutputImagePixelType m_MinValueInSphere;
337 IndexType m_MinValueIndexInSphere;
338 unsigned int m_NumberOfGaussians;
340 unsigned int m_RadiusStepNumber;
341 OutputImagePixelType m_MeanValue;
342 OutputImagePixelType m_ValueAtMidpoint;
343 IndexType m_SphereMidpoint;
347 VectorType m_CenterX;
348 VectorType m_CenterY;
349 VectorType m_CenterZ;
350 VectorType m_Altitude;
351 ItkVectorType m_RegionOfInterestMax;
352 ItkVectorType m_RegionOfInterestMin;
355 PointType m_GlobalCoordinate;
357 MapContainerPoints m_Midpoints;
358 MapContainerRadius m_RadiusCuboid;
360 double m_NormalDistValues [410];
361 double m_meanValueTemp;
364 mutable PointValueArrayType m_OriginArray;
365 mutable SpacingValueArrayType m_SpacingArray;
370 #ifndef ITK_MANUAL_INSTANTIATION
371 #include "itkMultiGaussianImageSource.hxx"
TOutputImage::IndexType IndexType
itk::SmartPointer< Self > Pointer
MultiGaussianImageSource Self
TOutputImage::PointValueType PointValueType
TOutputImage::SpacingValueType SpacingValueType
SizeType::SizeValueType SizeValueType
TOutputImage::SpacingType SpacingType
SmartPointer< Self > Pointer
Generate an 3-dimensional multigaussian image.
ImageRegionIteratorWithIndex< TOutputImage > IteratorType
TOutputImage::RegionType OutputImageRegionType
MapContainer< unsigned int, PointType > MapContainerPoints
MapContainer< unsigned int, double > MapContainerRadius
std::vector< double > VectorType
TOutputImage::PointType PointType
TOutputImage::Pointer ImageType
TOutputImage::PixelType OutputImagePixelType
Vector< double, TOutputImage::ImageDimension > ItkVectorType
SmartPointer< const Self > ConstPointer
itk::ImageRegion< 3 >::SizeValueType SizeRegionType
TOutputImage::SizeType SizeType
ImageSource< TOutputImage > Superclass