vvSlicerManager* selected_slicer = mSlicerManagers[GetSlicerIndexFromItem(DataTree->selectedItems()[0])];
QFileInfo info(selected_slicer->GetFileName().c_str());
mip.Compute(selected_slicer);
- AddImage(mip.GetOutput(),info.path().toStdString()+"/"+info.completeBaseName().toStdString()+"_mip.mhd");
+ if (!mip.error)
+ AddImage(mip.GetOutput(),info.path().toStdString()+"/"+info.completeBaseName().toStdString()+"_mip.mhd");
}
//------------------------------------------------------------------------------
#include "vvToITK.h"
#include "vvFromITK.h"
#include "vvMaximumIntensityProjection.h"
+#include <QMessageBox>
void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager)
{
std::string list = clitk::CreateListOfTypes<short>();
vvImage::Pointer image=slicer_manager->GetSlicer(0)->GetImage();
TRY_TYPE(float);
+ TRY_TYPE(double);
+ TRY_TYPE(int);
+ TRY_TYPE(unsigned int);
TRY_TYPE(short);
- std::cerr << "Error, I don't know the type '" << image->GetScalarTypeAsString() << "' for the input image. "
- << std::endl << "Known types are " << list << std::endl;
- exit(0);
+ 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()));
+ error=true;
#undef TRY_TYPE
}
Update_WithDimAndPixelType<PixelType,4>(image);
break;;
default:
- DD("Error: dimension not handled.");
+ QMessageBox::warning(0,"Unsupported image dimension",QString("Unsupported image dimension. Supported dimensions are 3 and 4"));
+ error=true;
}
}
///Computes the MIP image on the given vvImage
void Compute(vvSlicerManager*);
vvImage::Pointer GetOutput() {return mOutputImage;};
+ bool error;
protected:
template<class PixelType,int Dim> void Update_WithDimAndPixelType(vvImage::Pointer);