vtkMimxImageActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   MIMX Meshing Toolkit
00004 Module:    $RCSfile: vtkMimxImageActor.h,v $
00005 Language:  C++
00006 Date:      $Date: 2008/07/11 03:12:06 $
00007 Version:   $Revision: 1.3 $
00008 
00009  Musculoskeletal Imaging, Modelling and Experimentation (MIMX)
00010  Center for Computer Aided Design
00011  The University of Iowa
00012  Iowa City, IA 52242
00013  http://www.ccad.uiowa.edu/mimx/
00014  
00015 Copyright (c) The University of Iowa. All rights reserved.
00016 See MIMXCopyright.txt or http://www.ccad.uiowa.edu/mimx/Copyright.htm for details.
00017 
00018 This software is distributed WITHOUT ANY WARRANTY; without even 
00019 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00020 PURPOSE.  See the above copyright notices for more information.
00021 
00022 =========================================================================*/
00023 
00024 // .NAME vtkMimxImageActor - a 3D non-orthogonal axes representation
00025 // .SECTION Description
00026 // vtkMimxImageActor is the abstract base class for all the pipeline setup for
00027 // different types of datatypes. Data types concidered are vtkPolyData,
00028 // vtkStructuredGrid (both plane and solid) and vtkUnstructuredGrid.
00029 
00030 #ifndef __vtkMimxImageActor_h
00031 #define __vtkMimxImageActor_h
00032 
00033 #include "vtkMimxActorBase.h"
00034 
00035 #include "itkImage.h"
00036 #include "itkImageFileReader.h"
00037 #include "itkImageToVTKImageFilter.h"
00038 #include "vtkImageData.h"
00039 #include "vtkMimxCommonWin32Header.h"
00040 #include "vtkMatrix4x4.h"
00041 
00042 
00043 class vtkImageFlip;
00044 class vtkImagePlaneWidget;
00045 class vtkRenderWindowInteractor;
00046 class vtkMatrix4x4;
00047 
00048 typedef itk::Image<signed short, 3>  ImageType;
00049 
00050 class VTK_MIMXCOMMON_EXPORT vtkMimxImageActor : public vtkMimxActorBase
00051 {
00052 public:
00053   static vtkMimxImageActor *New();
00054   vtkTypeRevisionMacro(vtkMimxImageActor,vtkMimxActorBase);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056   vtkImageData* GetDataSet();
00057   //void SetDataType(int){};
00058   ImageType* GetITKImage();
00059   void SetITKImageFilePath(const char* FPath);
00060 
00061   // added so we can initialize from Slicer volume
00062   void SetImageDataSet(vtkImageData* image);
00063   void SetImageDataSet(vtkImageData* image, vtkMatrix4x4* matrix, double origin[3], double spacing[3]);
00064   void InitializePlaneWidgets();
00065   void InitializePlaneWidgets(vtkMatrix4x4* matrix, double origin[3], double spacing[3]);
00066 
00067   vtkSetObjectMacro(RASToIJKMatrix,vtkMatrix4x4);
00068   vtkGetObjectMacro(RASToIJKMatrix,vtkMatrix4x4);
00069 
00070   void SetInteractor(vtkRenderWindowInteractor *Int)
00071   {
00072          this->Interactor = Int;
00073   }
00074   void DisplayActor(int Display);
00075   int GetActorVisibility();
00076 
00077   vtkMimxImageActor();
00078   ~vtkMimxImageActor();
00079 
00080    double Origin[3];  // info copied from originating volume
00081    double Spacing[3]; // info copied from originating volume
00082 
00083 protected:
00084   typedef itk::ImageFileReader<ImageType> ReaderType;
00085   typedef itk::ImageToVTKImageFilter<ImageType> FilterType;
00086 
00087   // this is the matrix showing orientation in Slicer3 world space. It is initialized when the actor
00088   // is created during a slicer volume import
00089   vtkMatrix4x4 *RASToIJKMatrix;
00090   ReaderType::Pointer Reader;
00091   FilterType::Pointer   Filter;
00092   vtkImagePlaneWidget *PlaneX;
00093   vtkImagePlaneWidget *PlaneY;
00094   vtkImagePlaneWidget *PlaneZ;
00095   vtkRenderWindowInteractor *Interactor;
00096   vtkImageFlip* FlipFilter;
00097 
00098   // this is a pointer to the current VTK form of the dataset.  All methods are
00099   // required to update this so it is always current.
00100 
00101   vtkImageData* SavedImage;
00102 
00103 
00104 private:
00105   vtkMimxImageActor(const vtkMimxImageActor&);  // Not implemented.
00106   void operator=(const vtkMimxImageActor&);  // Not implemented.
00107 };
00108 
00109 #endif
00110 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1