#include "imageModificationManager.h"
-#define GETVALUE_MANUALPAINT(VALUE,POINTER,SCALARTYPE) \
- if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)*((double*)POINTER); } \
- else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)*((float*)POINTER); } \
- else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)*((char*)POINTER); } \
- else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)*((unsigned char*)POINTER); } \
- else if (SCALARTYPE==VTK_INT) { VALUE=(double)*((int*)POINTER); } \
- else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)*((unsigned int*)POINTER); } \
- else if (SCALARTYPE==VTK_LONG) { VALUE=(double)*((long*)POINTER); } \
- else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)*((unsigned long*)POINTER); } \
- else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)*((short*)POINTER); } \
- else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)*((unsigned short*)POINTER);} \
- else { printf("EED GETVALUE_MANUALPAINT error\n"); }
-
-#define GETVALUE2_MANUALPAINT(VALUE,POINTER,SCALARTYPE,INDEX) \
- if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)((double*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)((float*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)((char*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)((unsigned char*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_INT) { VALUE=(double)((int*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)((unsigned int*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_LONG) { VALUE=(double)((long*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)((unsigned long*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)((short*)POINTER)[INDEX]; } \
- else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)((unsigned short*)POINTER)[INDEX]; } \
- else { printf("EED GETVALUE2_MANUALPAINT error\n"); }
-
-#define SETVALUE2_MANUALPAINT(VALUE,POINTER,SCALARTYPE,INDEX) \
- if (SCALARTYPE==VTK_DOUBLE) { ((double*)POINTER)[INDEX] = (double)VALUE; } \
- else if (SCALARTYPE==VTK_FLOAT) { ((float*)POINTER)[INDEX] = (float)VALUE; } \
- else if (SCALARTYPE==VTK_CHAR) { ((char*)POINTER)[INDEX] = (char)VALUE; } \
- else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { ((unsigned char*)POINTER)[INDEX] = (unsigned char)VALUE; } \
- else if (SCALARTYPE==VTK_INT) { ((int*)POINTER)[INDEX] = (int)VALUE; } \
- else if (SCALARTYPE==VTK_UNSIGNED_INT) { ((unsigned int*)POINTER)[INDEX] = (unsigned int)VALUE; } \
- else if (SCALARTYPE==VTK_LONG) { ((long*)POINTER)[INDEX] = (long)VALUE; } \
- else if (SCALARTYPE==VTK_UNSIGNED_LONG) { ((unsigned long*)POINTER)[INDEX] = (unsigned long)VALUE; } \
- else if (SCALARTYPE==VTK_SHORT) { ((short*)POINTER)[INDEX] = (short)VALUE; } \
- else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ ((unsigned short*)POINTER)[INDEX] = (unsigned short)VALUE;} \
- else { printf("EED SETVALUE2_MANUALPAINT error\n"); }
-
-
-#define DEFINEPOINTERIMAGE_MANUALPAINT(VALUE,SCALARSIZE,POINTERIMAGE,SCALARTYPE,IMAGE) \
- double VALUE = 0; \
- int SCALARSIZE = IMAGE->GetScalarSize(); \
- char *POINTERIMAGE = (char*)(IMAGE->GetScalarPointer()); \
- int SCALARTYPE = IMAGE->GetScalarType();
-
-
-
-
class baseFilterManualPaint {
public:
baseFilterManualPaint();
virtual ~baseFilterManualPaint();
-
virtual void SetImages(vtkImageData *image,vtkImageData *image2);
void SetPoint(int px, int py, int pz);
void Set2D3D(int dim2D3D);
void ResetGeneralMinMax();
void SetGeneralMinMax(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
void GetScalarRange(double * range);
-
void SetRangeMin( int min );//DFCH
void SetRangeMax( int max );//DFCH
int GetRangeMin( ); //DFCH
int GetRangeMax( ); //DFCH
-
ImageMManager* GetImageMManager(); //DFCH
void CleanImageMManager(); //DFCH
virtual void Run();
-
private:
-
protected:
ImageMManager *_IMManager; //Saves the last modified region (MinX, MaxX, MinY, MaxY, MinZ, MaxZ).
vtkImageData *_image;
double _graylevel;
int _RangeMin;
int _RangeMax;
-
-
};
#endif // _BASE_FILTER_MANUAL_PAINT_H_