X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMaximumIntensityProjection.cxx;h=4eb84f7dfe8c2f252100cb33360201f100df4828;hb=915bf2f85e1afdd1fdacfb7aa14e1f3b5bef269d;hp=077a884cab2932e48a4070d0439020e733181a73;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/vv/vvMaximumIntensityProjection.cxx b/vv/vvMaximumIntensityProjection.cxx index 077a884..4eb84f7 100644 --- a/vv/vvMaximumIntensityProjection.cxx +++ b/vv/vvMaximumIntensityProjection.cxx @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ + ======================================================================-====*/ #include #include @@ -25,11 +25,14 @@ #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->GetScalarTypeAsString())) { this->Update_WithPixelType(image); return; } + if (clitk::IsSameType(image->GetScalarTypeAsITKString())) { this->Update_WithPixelType(image); return; } std::string list = clitk::CreateListOfTypes(); vvImage::Pointer image=slicer_manager->GetSlicer(0)->GetImage(); TRY_TYPE(float); @@ -40,7 +43,8 @@ if (clitk::IsSameType(image->GetScalarTypeAsString())) { this->Update_With TRY_TYPE(unsigned short); TRY_TYPE(char); TRY_TYPE(unsigned char); - QMessageBox::warning(0,"Unsupported image type",QString("Error, I don't know the type")+QString(image->GetScalarTypeAsString().c_str()) +QString("' for the input image.\nKnown types are ") + QString(list.c_str())); + QMessageBox::warning(0,"Unsupported image type", + QString("Error, I don't know the type")+QString(image->GetScalarTypeAsITKString().c_str()) +QString("' for the input image.\nKnown types are ") + QString(list.c_str())); error=true; #undef TRY_TYPE } @@ -68,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();