From: schaerer Date: Tue, 5 Oct 2010 13:26:37 +0000 (+0000) Subject: allow the user to chose the axis along which to compute the mip X-Git-Tag: v1.2.0~355 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=915bf2f85e1afdd1fdacfb7aa14e1f3b5bef269d;p=clitk.git allow the user to chose the axis along which to compute the mip --- diff --git a/vv/vvMaximumIntensityProjection.cxx b/vv/vvMaximumIntensityProjection.cxx index 7c2c3d7..4eb84f7 100644 --- a/vv/vvMaximumIntensityProjection.cxx +++ b/vv/vvMaximumIntensityProjection.cxx @@ -25,9 +25,12 @@ #include "vvFromITK.h" #include "vvMaximumIntensityProjection.h" #include +#include 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(image->GetScalarTypeAsITKString())) { this->Update_WithPixelType(image); return; } std::string list = clitk::CreateListOfTypes(); @@ -69,7 +72,7 @@ void vvMaximumIntensityProjection::Update_WithDimAndPixelType(vvImage::Pointer i typedef itk::Image OutputImageType; typedef itk::MaximumProjectionImageFilter FilterType; typename FilterType::Pointer filter = FilterType::New(); - filter->SetProjectionDimension(Dim-1); + filter->SetProjectionDimension(mDimension); typename ImageType::ConstPointer input = vvImageToITK(image); filter->SetInput(input); filter->Update(); diff --git a/vv/vvMaximumIntensityProjection.h b/vv/vvMaximumIntensityProjection.h index 6da17f0..9d15164 100644 --- a/vv/vvMaximumIntensityProjection.h +++ b/vv/vvMaximumIntensityProjection.h @@ -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 void Update_WithDimAndPixelType(vvImage::Pointer); template void Update_WithPixelType(vvImage::Pointer); vvImage::Pointer mOutputImage; + //Dimension along which to compute the MIP + unsigned int mDimension; }; #endif