diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h index 38723f7d92..c300d8e5a5 100644 --- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h +++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h @@ -1,96 +1,95 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkExtractDirectedPlaneImageFilter_h_Included #define mitkExtractDirectedPlaneImageFilter_h_Included -//#include "mitkCommon.h" -#include "MitkExtExports.h" +#include "ImageExtractionExports.h" #include "mitkImageToImageFilter.h" #include "vtkImageReslice.h" class vtkPoints; namespace mitk { /** \brief Extracts a 2D slice of arbitrary geometry from a 3D or 4D image. \sa mitkImageMapper2D \ingroup ImageToImageFilter This class takes a 3D or 4D mitk::Image as input and tries to extract one slice from it. This slice can be arbitrary oriented in space. The 2D slice is resliced by a vtk::ResliceImage filter if not perpendicular to the input image. The world geometry of the plane to be extracted image must be given as an input to the filter in order to correctly calculate world coordinates of the extracted slice. Setting a timestep from which the plane should be extracted is optional. Output will not be set if there was a problem extracting the desired slice. Last contributor: $Author: T. Schwarz$ */ - class MitkExt_EXPORT ExtractDirectedPlaneImageFilter : public ImageToImageFilter + class ImageExtraction_EXPORT ExtractDirectedPlaneImageFilter : public ImageToImageFilter { public: mitkClassMacro(ExtractDirectedPlaneImageFilter, ImageToImageFilter); itkNewMacro(ExtractDirectedPlaneImageFilter); itkSetMacro( WorldGeometry, Geometry2D* ); // The Reslicer is accessible to configure the desired interpolation; // (See vtk::ImageReslice class for documentation). // Misusage is at your own risk... itkGetMacro( Reslicer, vtkImageReslice* ); // The target timestep in a 4D image from which the 2D plane is supposed // to be extracted. itkSetMacro( TargetTimestep, unsigned int ); itkGetMacro( TargetTimestep, unsigned int ); itkSetMacro( InPlaneResampleExtentByGeometry, bool ); itkGetMacro( InPlaneResampleExtentByGeometry, bool ); protected: ExtractDirectedPlaneImageFilter(); // purposely hidden virtual ~ExtractDirectedPlaneImageFilter(); virtual void GenerateData(); virtual void GenerateOutputInformation(); bool CalculateClippedPlaneBounds( const Geometry3D *boundingGeometry, const PlaneGeometry *planeGeometry, vtkFloatingPointType *bounds ); bool LineIntersectZero( vtkPoints *points, int p1, int p2, vtkFloatingPointType *bounds ); const Geometry2D* m_WorldGeometry; vtkImageReslice * m_Reslicer; unsigned int m_TargetTimestep; bool m_InPlaneResampleExtentByGeometry; }; } // namespace mitk #endif // mitkExtractDirectedPlaneImageFilter_h_Included diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h index 07296908c2..eed507a109 100644 --- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h +++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h @@ -1,94 +1,94 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2010-12-02 14:54:03 +0100 (Do, 2 Dec 2010) $ Version: $Revision: 21147 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkExtractDirectedPlaneImageFilterNew_h_Included #define mitkExtractDirectedPlaneImageFilterNew_h_Included -#include "MitkExtExports.h" +#include "ImageExtractionExports.h" #include "mitkImageToImageFilter.h" #include "itkImage.h" #include "mitkITKImageImport.h" namespace mitk { /** \brief A filter that can extract a 2D slice from a 3D or 4D image especially if the image`s axes are rotated \sa ContourTool \sa SegTool2D \sa ExtractImageFilter \sa OverwriteSliceImageFilter \sa OverwriteDirectedPlaneImageFilter \ingroup Process \ingroup Reliver There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref QmitkSegmentationTechnicalPage This class takes an 3D or 4D mitk::Image as input and extracts a slice from it. If you work with a 4D image as input you have to specify the desired timestep at which the slice shall be extracted, otherwise the lowest given timestep is selected by default. The special feature of this filter is, that the planes of the input image can be rotated in any way. To assure a proper extraction you have to set the currentWorldGeometry2D with you can obtain from the BaseRenderer, respectively the positionEvent send by the renderer. The output will not be set if there was a problem with the input image $Author: fetzer $ */ -class MitkExt_EXPORT ExtractDirectedPlaneImageFilterNew : public ImageToImageFilter +class ImageExtraction_EXPORT ExtractDirectedPlaneImageFilterNew : public ImageToImageFilter { public: mitkClassMacro(ExtractDirectedPlaneImageFilterNew, ImageToImageFilter); itkNewMacro(Self); /** \brief Set macro for the current worldgeometry \a Parameter The current wordgeometry that describes the position (rotation, translation) of the plane (and therefore the slice to be extracted) in our 3D(+t) image */ itkSetMacro(CurrentWorldGeometry2D, Geometry3D* ); itkSetMacro(ImageGeometry, Geometry3D* ); /** \brief Set macro for the current timestep \a Parameter The timestep of the image from which the slice shall be extracted */ itkSetMacro(ActualInputTimestep, int); protected: ExtractDirectedPlaneImageFilterNew(); virtual ~ExtractDirectedPlaneImageFilterNew(); virtual void GenerateData(); virtual void GenerateOutputInformation(); private: const Geometry3D* m_CurrentWorldGeometry2D; const Geometry3D* m_ImageGeometry; int m_ActualInputTimestep; template void ItkSliceExtraction (itk::Image* inputImage); }; }//namespace #endif diff --git a/Modules/ImageExtraction/mitkExtractImageFilter.h b/Modules/ImageExtraction/mitkExtractImageFilter.h index da7f8e882f..da4d11a24b 100644 --- a/Modules/ImageExtraction/mitkExtractImageFilter.h +++ b/Modules/ImageExtraction/mitkExtractImageFilter.h @@ -1,99 +1,99 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef mitkExtractImageFilter_h_Included #define mitkExtractImageFilter_h_Included #include "mitkCommon.h" -#include "MitkExtExports.h" +#include "ImageExtractionExports.h" #include "mitkImageToImageFilter.h" #include "itkImage.h" namespace mitk { /** \brief Extracts a 2D slice from a 3D image. \sa SegTool2D \sa OverwriteSliceImageFilter \ingroup Process \ingroup ToolManagerEtAl There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref QmitkSegmentationTechnicalPage This class takes a 3D mitk::Image as input and tries to extract one slice from it. Two parameters determine which slice is extracted: the "slice dimension" is that one, which is constant for all points in the plane, e.g. transversal would mean 2. The "slice index" is the slice index in the image direction you specified with "affected dimension". Indices count from zero. Output will not be set if there was a problem extracting the desired slice. Last contributor: $Author$ */ -class MitkExt_EXPORT ExtractImageFilter : public ImageToImageFilter +class ImageExtraction_EXPORT ExtractImageFilter : public ImageToImageFilter { public: mitkClassMacro(ExtractImageFilter, ImageToImageFilter); itkNewMacro(ExtractImageFilter); /** \brief Which slice to extract (first one has index 0). */ itkSetMacro(SliceIndex, unsigned int); itkGetConstMacro(SliceIndex, unsigned int); /** \brief The orientation of the slice to be extracted. \a Parameter SliceDimension Number of the dimension which is constant for all pixels of the desired slice (e.g. 2 for transversal) */ itkSetMacro(SliceDimension, unsigned int); itkGetConstMacro(SliceDimension, unsigned int); /** \brief Time step of the image to be extracted. */ itkSetMacro(TimeStep, unsigned int); itkGetConstMacro(TimeStep, unsigned int); protected: ExtractImageFilter(); // purposely hidden virtual ~ExtractImageFilter(); virtual void GenerateOutputInformation(); virtual void GenerateInputRequestedRegion(); virtual void GenerateData(); template void ItkImageProcessing( itk::Image* image ); unsigned int m_SliceIndex; unsigned int m_SliceDimension; unsigned int m_TimeStep; }; } // namespace #endif diff --git a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h index 15c36a257d..96498533ea 100644 --- a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h +++ b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h @@ -1,298 +1,298 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ Version: $Revision: 17179 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _MITK_IMAGESTATISTICSCALCULATOR_H #define _MITK_IMAGESTATISTICSCALCULATOR_H #include -#include "MitkExtExports.h" +#include "ImageStatisticsExports.h" #include #include #include "mitkImage.h" #include "mitkImageTimeSelector.h" #include "mitkPlanarFigure.h" #include namespace mitk { /** * \brief Class for calculating statistics and histogram for an (optionally * masked) image. * * Images can be masked by either a (binary) image (of the same dimensions as * the original image) or by a closed mitk::PlanarFigure, e.g. a circle or * polygon. When masking with a planar figure, the slice corresponding to the * plane containing the figure is extracted and then clipped with contour * defined by the figure. Planar figures need to be aligned along the main axes * of the image (transversal, sagittal, coronal). Planar figures on arbitrary * rotated planes are not supported. * * For each operating mode (no masking, masking by image, masking by planar * figure), the calculated statistics and histogram are cached so that, when * switching back and forth between operation modes without modifying mask or * image, the information doesn't need to be recalculated. * * Note: currently time-resolved and multi-channel pictures are not properly * supported. */ -class MitkExt_EXPORT ImageStatisticsCalculator : public itk::Object +class ImageStatistics_EXPORT ImageStatisticsCalculator : public itk::Object { public: enum { MASKING_MODE_NONE = 0, MASKING_MODE_IMAGE, MASKING_MODE_PLANARFIGURE }; typedef mitk::Image::HistogramType HistogramType; typedef mitk::Image::HistogramType::ConstIterator HistogramConstIteratorType; struct Statistics { unsigned int N; double Min; double Max; double Mean; double Median; double Variance; double Sigma; double RMS; void Reset() { N = 0; Min = 0.0; Max = 0.0; Mean = 0.0; Median = 0.0; Variance = 0.0; Sigma = 0.0; RMS = 0.0; } }; mitkClassMacro( ImageStatisticsCalculator, itk::Object ); itkNewMacro( ImageStatisticsCalculator ); /** \brief Set image from which to compute statistics. */ void SetImage( const mitk::Image *image ); /** \brief Set binary image for masking. */ void SetImageMask( const mitk::Image *imageMask ); /** \brief Set planar figure for masking. */ void SetPlanarFigure( const mitk::PlanarFigure *planarFigure ); /** \brief Set/Get operation mode for masking */ void SetMaskingMode( unsigned int mode ); /** \brief Set/Get operation mode for masking */ itkGetMacro( MaskingMode, unsigned int ); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToNone(); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToImage(); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToPlanarFigure(); /** \brief Set a pixel value for pixels that will be ignored in the statistics */ void SetIgnorePixelValue(double value); /** \brief Get the pixel value for pixels that will be ignored in the statistics */ double GetIgnorePixelValue(); /** \brief Set wether a pixel value should be ignored in the statistics */ void SetDoIgnorePixelValue(bool doit); /** \brief Get wether a pixel value will be ignored in the statistics */ bool GetDoIgnorePixelValue(); /** \brief Compute statistics (together with histogram) for the current * masking mode. * * Computation is not executed if statistics is already up to date. In this * case, false is returned; otherwise, true.*/ virtual bool ComputeStatistics( unsigned int timeStep = 0 ); /** \brief Retrieve the histogram depending on the current masking mode. */ const HistogramType *GetHistogram( unsigned int timeStep = 0 ) const; /** \brief Retrieve statistics depending on the current masking mode. */ const Statistics &GetStatistics( unsigned int timeStep = 0 ) const; protected: typedef std::vector< HistogramType::ConstPointer > HistogramVectorType; typedef std::vector< Statistics > StatisticsVectorType; typedef std::vector< itk::TimeStamp > TimeStampVectorType; typedef std::vector< bool > BoolVectorType; typedef itk::Image< unsigned short, 3 > MaskImage3DType; typedef itk::Image< unsigned short, 2 > MaskImage2DType; ImageStatisticsCalculator(); virtual ~ImageStatisticsCalculator(); /** \brief Depending on the masking mode, the image and mask from which to * calculate statistics is extracted from the original input image and mask * data. * * For example, a when using a PlanarFigure as mask, the 2D image slice * corresponding to the PlanarFigure will be extracted from the original * image. If masking is disabled, the original image is simply passed * through. */ void ExtractImageAndMask( unsigned int timeStep = 0 ); /** \brief If the passed vector matches any of the three principal axes * of the passed geometry, the ínteger value corresponding to the axis * is set and true is returned. */ bool GetPrincipalAxis( const Geometry3D *geometry, Vector3D vector, unsigned int &axis ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsUnmasked( const itk::Image< TPixel, VImageDimension > *image, Statistics &statistics, typename HistogramType::ConstPointer *histogram ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsMasked( const itk::Image< TPixel, VImageDimension > *image, itk::Image< unsigned short, VImageDimension > *maskImage, Statistics &statistics, typename HistogramType::ConstPointer *histogram ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateMaskFromPlanarFigure( const itk::Image< TPixel, VImageDimension > *image, unsigned int axis ); template < typename TPixel, unsigned int VImageDimension > void InternalMaskIgnoredPixels( const itk::Image< TPixel, VImageDimension > *image, itk::Image< unsigned short, VImageDimension > *maskImage ); /** Connection from ITK to VTK */ template void ConnectPipelines(ITK_Exporter exporter, vtkSmartPointer importer) { importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback()); importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback()); importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback()); importer->SetSpacingCallback(exporter->GetSpacingCallback()); importer->SetOriginCallback(exporter->GetOriginCallback()); importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback()); importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback()); importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback()); importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback()); importer->SetDataExtentCallback(exporter->GetDataExtentCallback()); importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback()); importer->SetCallbackUserData(exporter->GetCallbackUserData()); } /** Connection from VTK to ITK */ template void ConnectPipelines(vtkSmartPointer exporter, ITK_Importer importer) { importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback()); importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback()); importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback()); importer->SetSpacingCallback(exporter->GetSpacingCallback()); importer->SetOriginCallback(exporter->GetOriginCallback()); importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback()); importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback()); importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback()); importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback()); importer->SetDataExtentCallback(exporter->GetDataExtentCallback()); importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback()); importer->SetCallbackUserData(exporter->GetCallbackUserData()); } void UnmaskedStatisticsProgressUpdate(); void MaskedStatisticsProgressUpdate(); mitk::Image::ConstPointer m_Image; mitk::Image::ConstPointer m_ImageMask; mitk::PlanarFigure::ConstPointer m_PlanarFigure; HistogramVectorType m_ImageHistogramVector; HistogramVectorType m_MaskedImageHistogramVector; HistogramVectorType m_PlanarFigureHistogramVector; HistogramType::Pointer m_EmptyHistogram; StatisticsVectorType m_ImageStatisticsVector; StatisticsVectorType m_MaskedImageStatisticsVector; StatisticsVectorType m_PlanarFigureStatisticsVector; Statistics m_EmptyStatistics; unsigned int m_MaskingMode; bool m_MaskingModeChanged; mitk::Image::ConstPointer m_InternalImage; MaskImage3DType::Pointer m_InternalImageMask3D; MaskImage2DType::Pointer m_InternalImageMask2D; TimeStampVectorType m_ImageStatisticsTimeStampVector; TimeStampVectorType m_MaskedImageStatisticsTimeStampVector; TimeStampVectorType m_PlanarFigureStatisticsTimeStampVector; BoolVectorType m_ImageStatisticsCalculationTriggerVector; BoolVectorType m_MaskedImageStatisticsCalculationTriggerVector; BoolVectorType m_PlanarFigureStatisticsCalculationTriggerVector; double m_IgnorePixelValue; bool m_DoIgnorePixelValue; bool m_IgnorePixelValueChanged; }; } #endif // #define _MITK_IMAGESTATISTICSCALCULATOR_H diff --git a/Modules/ImageStatistics/mitkvtkImageStencilRaster.h b/Modules/ImageStatistics/mitkvtkImageStencilRaster.h index 1815d054fa..7e2c0b0bf6 100644 --- a/Modules/ImageStatistics/mitkvtkImageStencilRaster.h +++ b/Modules/ImageStatistics/mitkvtkImageStencilRaster.h @@ -1,98 +1,98 @@ /*========================================================================= Program: Visualization Toolkit Module: vtkImageStencilData.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkImageStencilData - efficient description of an image stencil // .SECTION Description // vtkImageStencilData describes an image stencil in a manner which is // efficient both in terms of speed and storage space. The stencil extents // are stored for each x-row across the image (multiple extents per row if // necessary) and can be retrieved via the GetNextExtent() method. // .SECTION see also // vtkImageStencilSource vtkImageStencil #ifndef __vtkImageStencilRaster_h #define __vtkImageStencilRaster_h #include "vtkImageStencilData.h" #include "vtkDataObject.h" -#include "MitkExtExports.h" +#include "ImageStatisticsExports.h" //BTX // Description: // This is a helper class for stencil creation. It is a raster with // infinite resolution in the X direction (approximately, since it uses // double precision). Lines that represent polygon edges can be drawn // into this raster, and then filled given a tolerance. -class MitkExt_EXPORT vtkImageStencilRaster +class ImageStatistics_EXPORT vtkImageStencilRaster { public: // Description: // Create a raster with the specified whole y extent. vtkImageStencilRaster(const int wholeExtent[2]); // Description: // Destructor. ~vtkImageStencilRaster(); // Description: // Reset the raster to its original state, but keep the same whole // extent. Pre-allocate the specified 1D allocateExtent, which must be // within the whole extent. void PrepareForNewData(const int allocateExtent[2] = 0); // Description: // Insert a line into the raster, given the two end points. // The "inflect1" and "inflect2" should be set if you want // to add a small vertical tolerance to either endpoints. void InsertLine(const double p1[2], const double p2[2], bool inflect1, bool inflect2); // Description: // Fill the specified extent of a vtkImageStencilData with the raster, // after permuting the raster according to xj and yj. void FillStencilData(vtkImageStencilData *data, const int extent[6], int xj = 0, int yj = 1); // Description: // The tolerance for float-to-int conversions. void SetTolerance(double tol) { this->Tolerance = tol; } double GetTolerance() { return this->Tolerance; } protected: // Description: // Ensure that the raster is initialized for the specified range // of y values, which must be within the Extent. void PrepareExtent(int ymin, int ymax); // Description: // Insert an x point into the raster. If the y value is larger // than the y extent, the extent will grow automatically. void InsertPoint(int y, double x); int Extent[2]; int UsedExtent[2]; double **Raster; double Tolerance; private: vtkImageStencilRaster(const vtkImageStencilRaster&); // Not implemented. void operator=(const vtkImageStencilRaster&); // Not implemented. }; //ETX #endif diff --git a/Modules/ImageStatistics/mitkvtkLassoStencilSource.h b/Modules/ImageStatistics/mitkvtkLassoStencilSource.h index 86ada7a3b7..f6eb5dd66e 100644 --- a/Modules/ImageStatistics/mitkvtkLassoStencilSource.h +++ b/Modules/ImageStatistics/mitkvtkLassoStencilSource.h @@ -1,107 +1,107 @@ /*========================================================================= Program: Visualization Toolkit Module: vtkLassoStencilSource.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkLassoStencilSource - Create a stencil from a contour // .SECTION Description // vtkLassoStencilSource will create an image stencil from a // set of points that define a contour. Its output can be // used with vtkImageStecil or other vtk classes that apply // a stencil to an image. // .SECTION See Also // vtkROIStencilSource vtkPolyDataToImageStencil // .SECTION Thanks // Thanks to David Gobbi for contributing this class to VTK. #ifndef __vtkLassoStencilSource_h #define __vtkLassoStencilSource_h #include "vtkImageStencilSource.h" -#include "MitkExtExports.h" +#include "ImageStatisticsExports.h" class vtkPoints; class vtkSpline; class vtkLSSPointMap; -class MitkExt_EXPORT vtkLassoStencilSource : public vtkImageStencilSource +class ImageStatistics_EXPORT vtkLassoStencilSource : public vtkImageStencilSource { public: static vtkLassoStencilSource *New(); vtkTypeMacro(vtkLassoStencilSource, vtkImageStencilSource); void PrintSelf(ostream& os, vtkIndent indent); //BTX enum { POLYGON = 0, SPLINE = 1, }; //ETX // Description: // The shape to use, default is "Polygon". The spline is a // cardinal spline. Bezier splines are not yet supported. vtkGetMacro(Shape, int); vtkSetClampMacro(Shape, int, POLYGON, SPLINE); void SetShapeToPolygon() { this->SetShape(POLYGON); }; void SetShapeToSpline() { this->SetShape(SPLINE); }; virtual const char *GetShapeAsString(); // Description: // The points that make up the lassoo. The loop does not // have to be closed, the last point will automatically be // connected to the first point by a straight line segment. virtual void SetPoints(vtkPoints *points); vtkGetObjectMacro(Points, vtkPoints); // Description: // The slice orientation. The default is 2, which is XY. // Other values are 0, which is YZ, and 1, which is XZ. vtkGetMacro(SliceOrientation, int); vtkSetClampMacro(SliceOrientation, int, 0, 2); // Description: // The points for a particular slice. This will override the // points that were set by calling SetPoints() for the slice. // To clear the setting, call SetSlicePoints(slice, NULL). virtual void SetSlicePoints(int i, vtkPoints *points); virtual vtkPoints *GetSlicePoints(int i); // Description: // Remove points from all slices. virtual void RemoveAllSlicePoints(); // Description: // Overload GetMTime() to include the timestamp on the points. unsigned long GetMTime(); protected: vtkLassoStencilSource(); ~vtkLassoStencilSource(); virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); int Shape; int SliceOrientation; vtkPoints *Points; vtkSpline *SplineX; vtkSpline *SplineY; vtkLSSPointMap *PointMap; private: vtkLassoStencilSource(const vtkLassoStencilSource&); // Not implemented. void operator=(const vtkLassoStencilSource&); // Not implemented. }; #endif