]> Creatis software - clitk.git/commitdiff
allow the user to chose the axis along which to compute the mip
authorschaerer <schaerer>
Tue, 5 Oct 2010 13:26:37 +0000 (13:26 +0000)
committerschaerer <schaerer>
Tue, 5 Oct 2010 13:26:37 +0000 (13:26 +0000)
vv/vvMaximumIntensityProjection.cxx
vv/vvMaximumIntensityProjection.h

index 7c2c3d7c68f132cb93c100de15de5724b965bfc2..4eb84f7dfe8c2f252100cb33360201f100df4828 100644 (file)
 #include "vvFromITK.h"
 #include "vvMaximumIntensityProjection.h"
 #include <QMessageBox>
+#include <QInputDialog>
 
 void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager)
 {
+  mDimension = QInputDialog::getInteger(0, "MIP Axis","Choose the axis along which to perform the MIP",0,0,\
+                                     slicer_manager->GetImage()->GetNumberOfDimensions()-1,1);
 #define TRY_TYPE(TYPE)                                                 \
   if (clitk::IsSameType<TYPE>(image->GetScalarTypeAsITKString())) { this->Update_WithPixelType<TYPE>(image); return; }
   std::string list = clitk::CreateListOfTypes<short>();
@@ -69,7 +72,7 @@ void vvMaximumIntensityProjection::Update_WithDimAndPixelType(vvImage::Pointer i
   typedef itk::Image<PixelType,Dim-1> OutputImageType;
   typedef itk::MaximumProjectionImageFilter<ImageType,OutputImageType> FilterType;
   typename FilterType::Pointer filter = FilterType::New();
-  filter->SetProjectionDimension(Dim-1);
+  filter->SetProjectionDimension(mDimension);
   typename ImageType::ConstPointer input = vvImageToITK<ImageType>(image);
   filter->SetInput(input);
   filter->Update();
index 6da17f0f52658b5bc04510fa83f57bfef31367e0..9d1516483978a52fbdb27fc715557545f6a013cb 100644 (file)
@@ -23,7 +23,7 @@ class vvSlicerManager;
 class vvMaximumIntensityProjection
 {
 public:
-    vvMaximumIntensityProjection() {};
+    vvMaximumIntensityProjection(): mDimension(0) {};
     ///Computes the MIP image on the given vvImage
     void Compute(vvSlicerManager*);
     vvImage::Pointer GetOutput() {return mOutputImage;};
@@ -33,6 +33,8 @@ protected:
     template<class PixelType,int Dim> void Update_WithDimAndPixelType(vvImage::Pointer);
     template<class PixelType> void Update_WithPixelType(vvImage::Pointer);
     vvImage::Pointer mOutputImage;
+    //Dimension along which to compute the MIP
+    unsigned int mDimension;
 };
 
 #endif