From: dsarrut Date: Tue, 22 Mar 2011 15:49:24 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v1.2.0~138 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3019905a0b56696012a9e4988a1def8b98db5a1b;p=clitk.git *** empty log message *** --- diff --git a/vv/vvMaximumIntensityProjection.cxx b/vv/vvMaximumIntensityProjection.cxx deleted file mode 100644 index c7ffb52..0000000 --- a/vv/vvMaximumIntensityProjection.cxx +++ /dev/null @@ -1,84 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ -#include -#include - -#include "clitkCommon.h" -#include "vvSlicerManager.h" -#include "vvSlicer.h" -#include "vvToITK.h" -#include "vvFromITK.h" -#include "vvMaximumIntensityProjection.h" -#include -#include - -void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager) -{ - mCurrentSlicerManager = 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(); - vvImage::Pointer image=slicer_manager->GetSlicer(0)->GetImage(); - TRY_TYPE(float); - TRY_TYPE(double); - TRY_TYPE(int); - TRY_TYPE(unsigned int); - TRY_TYPE(short); - 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->GetScalarTypeAsITKString().c_str()) +QString("' for the input image.\nKnown types are ") + QString(list.c_str())); - error=true; -#undef TRY_TYPE -} - -template -void vvMaximumIntensityProjection::Update_WithPixelType(vvImage::Pointer image) -{ - switch(image->GetNumberOfDimensions()) { - case 3: - Update_WithDimAndPixelType(image); - break;; - case 4: - Update_WithDimAndPixelType(image); - break;; - default: - QMessageBox::warning(0,"Unsupported image dimension",QString("Unsupported image dimension. Supported dimensions are 3 and 4")); - error=true; - } -} - -template -void vvMaximumIntensityProjection::Update_WithDimAndPixelType(vvImage::Pointer image) -{ - typedef itk::Image ImageType; - typedef itk::Image OutputImageType; - typedef itk::MaximumProjectionImageFilter FilterType; - typename FilterType::Pointer filter = FilterType::New(); - filter->SetProjectionDimension(mDimension); - typename ImageType::ConstPointer input = vvImageToITK(image); - filter->SetInput(input); - filter->Update(); - mOutputImage=vvImageFromITK(filter->GetOutput()); - // std::ostringstream osstream; - // osstream << "MIP_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd"; - // AddImage(mOutputImage,osstream.str()); -} diff --git a/vv/vvMaximumIntensityProjection.h b/vv/vvMaximumIntensityProjection.h deleted file mode 100644 index 8f37701..0000000 --- a/vv/vvMaximumIntensityProjection.h +++ /dev/null @@ -1,41 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef vvMaximumIntensityProjection_h -#define vvMaximumIntensityProjection_h -#include "vvImage.h" -class vvSlicerManager; - -class vvMaximumIntensityProjection -{ -public: - vvMaximumIntensityProjection(): mDimension(0) {}; - ///Computes the MIP image on the given vvImage - void Compute(vvSlicerManager*); - vvImage::Pointer GetOutput() {return mOutputImage;}; - bool error; - -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; - vvSlicerManager * mCurrentSlicerManager; -}; - -#endif