//---------------------------------------------------------------------------------------------------------------- // Class definition include //---------------------------------------------------------------------------------------------------------------- #include "ImageSourceThing.h" //---------------------------------------------------------------------------------------------------------------- // Class implementation //---------------------------------------------------------------------------------------------------------------- /** @file ImageSourceThing.cxx */ //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ /* * Creates the source image with the given parameter * @param sourceImage The image source to set. */ ImageSourceThing :: ImageSourceThing(vtkImageData * theSource) { setSourceImage(theSource); } /* * Destroys the image source */ ImageSourceThing :: ~ImageSourceThing() { } //------------------------------------------------------------------------------------------------------------ // Methods //------------------------------------------------------------------------------------------------------------ /* * Gets the source image * @return sourceImage The image source. */ vtkImageData * ImageSourceThing :: getSourceImage() { return sourceImage; } /* * Sets the source image * @param sourceImage The image source. */ void ImageSourceThing :: setSourceImage( vtkImageData * theSource) { sourceImage = theSource; } /** * Gets the max value of the x-axis * @return x-extend_MAX */ int ImageSourceThing :: getMax_X() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return x2; } /** * Gets the min value of the x-axis * @return x-extend_MIN */ int ImageSourceThing :: getMin_X() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return x1; } /** * Gets the range values of the x-axis * @return x-extend pointer to a 2 sized [] */ int * ImageSourceThing :: getRangeX() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); int* retVal = new int[2]; retVal[0]= x1; retVal[1]= x2; return retVal; } /** * Gets the max value of the y-axis * @return y-extend_MAX */ int ImageSourceThing :: getMax_Y() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return y2; } /** * Gets the min value of the y-axis * @return y-extend_MIN */ int ImageSourceThing :: getMin_Y() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return y1; } /** * Gets the range values of the y-axis * @return y-extend pointer to a 2 sized [] */ int * ImageSourceThing :: getRangeY() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); int* retVal = new int[2]; retVal[0]= y1; retVal[1]= y2; return retVal; } /** * Gets the max value of the z-axis * @return z-extend_MAX */ int ImageSourceThing :: getMax_Z() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return z2; } /** * Gets the min value of the z-axis * @return z-extend_MIN */ int ImageSourceThing :: getMin_Z() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); return z1; } /** * Gets the range values of the z-axis * @return z-extend pointer to a 2 sized [] */ int * ImageSourceThing :: getRangeZ() { int x1, x2, y1, y2, z1, z2; sourceImage ->GetExtent( x1, x2, y1, y2, z1, z2); int* retVal = new int[2]; retVal[0]= z1; retVal[1]= z2; return retVal; } /** * Gets the range values of the x-axis * @return x-extend pointer to a 6 sized [] */ int * ImageSourceThing :: getAllRanges() { return sourceImage-> GetExtent(); }