From: dsarrut Date: Wed, 7 Jul 2010 07:04:09 +0000 (+0000) Subject: correct GetScalarTypeAsITKString X-Git-Tag: v1.2.0~558 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=44afe6c93f185da1ac0debc227105bf56404482e;p=clitk.git correct GetScalarTypeAsITKString --- diff --git a/vv/vvImageWarp.cxx b/vv/vvImageWarp.cxx index 1fd6778..904e4cb 100644 --- a/vv/vvImageWarp.cxx +++ b/vv/vvImageWarp.cxx @@ -43,7 +43,7 @@ template void vvImageWarp::Update_WithDim() { #define TRY_TYPE(TYPE) \ - if (clitk::IsSameType(mInputImage->GetScalarTypeAsString())) { this->Update_WithDimAndPixelType(); return; } + if (clitk::IsSameType(mInputImage->GetScalarTypeAsITKString())) { this->Update_WithDimAndPixelType(); return; } // TRY_TYPE(signed char); // TRY_TYPE(uchar); TRY_TYPE(short); @@ -54,7 +54,7 @@ void vvImageWarp::Update_WithDim() #undef TRY_TYPE std::string list = clitk::CreateListOfTypes(); - std::cerr << "Error, I don't know the type '" << mInputImage->GetScalarTypeAsString() << "' for the input image. " + std::cerr << "Error, I don't know the type '" << mInputImage->GetScalarTypeAsITKString() << "' for the input image. " << std::endl << "Known types are " << list << std::endl; exit(0); } diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 28094df..1948e79 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -979,7 +979,7 @@ void vvMainWindow::ImageInfoChanged() inputSpacing.resize(dimension); inputSize.resize(dimension); sizeMM.resize(dimension); - pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str(); + pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str(); for (int i = 0; i < dimension; i++) { origin[i] = imageSelected->GetOrigin()[i]; inputSpacing[i] = imageSelected->GetSpacing()[i]; @@ -995,7 +995,7 @@ void vvMainWindow::ImageInfoChanged() inputSpacing.resize(dimension); inputSize.resize(dimension); sizeMM.resize(dimension); - pixelType = mSlicerManagers[index]->GetVF()->GetScalarTypeAsString().c_str(); + pixelType = mSlicerManagers[index]->GetVF()->GetScalarTypeAsITKString().c_str(); for (int i = 0; i < dimension; i++) { origin[i] = imageSelected->GetOrigin()[i]; inputSpacing[i] = imageSelected->GetSpacing()[i]; @@ -1011,7 +1011,7 @@ void vvMainWindow::ImageInfoChanged() inputSpacing.resize(dimension); inputSize.resize(dimension); sizeMM.resize(dimension); - pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str(); + pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str(); for (int i = 0; i < dimension; i++) { origin[i] = imageSelected->GetOrigin()[i]; inputSpacing[i] = imageSelected->GetSpacing()[i]; @@ -1027,7 +1027,7 @@ void vvMainWindow::ImageInfoChanged() inputSpacing.resize(dimension); inputSize.resize(dimension); sizeMM.resize(dimension); - pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str(); + pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str(); for (int i = 0; i < dimension; i++) { origin[i] = imageSelected->GetOrigin()[i]; inputSpacing[i] = imageSelected->GetSpacing()[i]; diff --git a/vv/vvMaximumIntensityProjection.cxx b/vv/vvMaximumIntensityProjection.cxx index 077a884..7c2c3d7 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 @@ -29,7 +29,7 @@ void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager) { #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 +40,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 } diff --git a/vv/vvMidPosition.cxx b/vv/vvMidPosition.cxx index 7d9f772..8e715e7 100644 --- a/vv/vvMidPosition.cxx +++ b/vv/vvMidPosition.cxx @@ -64,7 +64,7 @@ void vvMidPosition::run() error_message="Computation of midposition is only supported for 4D image sequences."; else if (!slicer_manager->GetVF()) error_message="A VF is required for midposition computation"; - else if (slicer_manager->GetVF()->GetScalarTypeAsString() != "float") + else if (slicer_manager->GetVF()->GetScalarTypeAsITKString() != "float") error_message="Please use a vector field of type float."; else { VFType::ConstPointer vf = vvImageToITK(slicer_manager->GetVF()); @@ -74,7 +74,7 @@ void vvMidPosition::run() inv_filter->SetInput(avg_vf); inv_filter->Update(); progress++; - if (slicer_manager->GetImage()->GetScalarTypeAsString() == "short") + if (slicer_manager->GetImage()->GetScalarTypeAsITKString() == "short") this->output=WarpRefImage(inv_filter->GetOutput(),slicer_manager->GetImage(),reference_image_index); else { error_message="Unsupported image pixel type."; diff --git a/vv/vvToolImageArithm.cxx b/vv/vvToolImageArithm.cxx index ad6343e..897e3d6 100644 --- a/vv/vvToolImageArithm.cxx +++ b/vv/vvToolImageArithm.cxx @@ -143,10 +143,10 @@ void vvToolImageArithm::apply() inputs.push_back(mInput2->GetImage()); // Check input type - if (inputs[0]->GetScalarTypeAsString() != inputs[1]->GetScalarTypeAsString()) { + if (inputs[0]->GetScalarTypeAsITKString() != inputs[1]->GetScalarTypeAsITKString()) { std::cerr << "Sorry inputs should have the same pixeltype." << std::endl; - std::cerr << "Input1 = " << inputs[0]->GetScalarTypeAsString() << std::endl; - std::cerr << "Input2 = " << inputs[1]->GetScalarTypeAsString() << std::endl; + std::cerr << "Input1 = " << inputs[0]->GetScalarTypeAsITKString() << std::endl; + std::cerr << "Input2 = " << inputs[1]->GetScalarTypeAsITKString() << std::endl; QApplication::restoreOverrideCursor(); QMessageBox::information(this, "Wrong image type","Sorry, could not perform operation. Please select inputs with same pixe type."); close(); diff --git a/vv/vvToolResample.cxx b/vv/vvToolResample.cxx index d3fc1fb..403775e 100644 --- a/vv/vvToolResample.cxx +++ b/vv/vvToolResample.cxx @@ -136,7 +136,7 @@ void vvToolResample::InputIsSelected(vvSlicerManager* m) mInputFileName = mCurrentSlicerManager->GetFileName().c_str(); // Set current information - mPixelType = mCurrentImage->GetScalarTypeAsString().c_str(); + mPixelType = mCurrentImage->GetScalarTypeAsITKString().c_str(); //ds ComponentType = mCurrentImageGetNumberOfScalarComponents(); mDimension = mCurrentImage->GetNumberOfDimensions(); diff --git a/vv/vvToolSimpleInputSelectorWidget.cxx b/vv/vvToolSimpleInputSelectorWidget.cxx index e7c7d0d..0f0860a 100644 --- a/vv/vvToolSimpleInputSelectorWidget.cxx +++ b/vv/vvToolSimpleInputSelectorWidget.cxx @@ -17,8 +17,12 @@ ======================================================================-====*/ #ifndef VVTOOLINPUTSELECTORWIDGET_CXX #define VVTOOLINPUTSELECTORWIDGET_CXX + +// vv #include "vvToolSimpleInputSelectorWidget.h" #include "vvSlicerManager.h" + +// qt #include //------------------------------------------------------------------------------ @@ -153,7 +157,7 @@ void vvToolSimpleInputSelectorWidget::changeInput(int index) spacing.append(QString("%1").arg(mCurrentImage->GetSpacing()[d-1])); mLabelInputInfo->setText(QString("%1D %2\n%3\n%4") .arg(d) - .arg(mCurrentImage->GetScalarTypeAsString().c_str()) + .arg(mCurrentImage->GetScalarTypeAsITKString().c_str()) .arg(size) .arg(spacing)); // DD("fin"); diff --git a/vv/vvToolWidgetBase.cxx b/vv/vvToolWidgetBase.cxx index d258aaf..58ff83c 100644 --- a/vv/vvToolWidgetBase.cxx +++ b/vv/vvToolWidgetBase.cxx @@ -190,7 +190,7 @@ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFil vvImage * s = mMainWindow->GetSlicerManagers()[i]->GetImage(); if (mFilter->CheckImageType(s->GetNumberOfDimensions(), s->GetNumberOfScalarComponents(), - s->GetScalarTypeAsString())) { + s->GetScalarTypeAsITKString())) { mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); if ((int)i == mMainWindow->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j; j++;