Skip to content

Commit

Permalink
COMP: Remove itkViewImage (merged into ITK)
Browse files Browse the repository at this point in the history
  • Loading branch information
phcerdan committed May 6, 2018
1 parent 3702105 commit 0f349fa
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 414 deletions.
3 changes: 0 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ endif()
#change it to ON to visualize images, for dev purposes.
option(ITK_VISUALIZE_TESTS "Visualize images in tests for development purposes. Require Module_ITKVtkGlue." OFF)
mark_as_advanced(ITK_VISUALIZE_TESTS)
if(ITK_VISUALIZE_TESTS)
list(APPEND IsotropicWaveletsTests runViewImage.cxx)
endif()

CreateTestDriver(IsotropicWavelets "${Libraries}" "${IsotropicWaveletsTests}")

Expand Down
2 changes: 1 addition & 1 deletion test/itkExpandWithZerosImageFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ runExpandWithZerosImageFilterTest( unsigned int expandFactor )
}

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( expander->GetOutput(), "ExpandWithZeros Output" );
itk::ViewImage::View( expander->GetOutput(), "ExpandWithZeros Output" );
#endif

// Test than expand with zeros + shrinkage (decimate) results on input image.
Expand Down
10 changes: 5 additions & 5 deletions test/itkFrequencyBandImageFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ itkFrequencyBandImageFilterTest( int argc, char* argv[] )
TRY_EXPECT_NO_EXCEPTION( passBandFilter->Update() );

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( passBandFilter->GetOutput(), "PassBand - default" );
itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - default" );
#endif

// Stop-band
Expand All @@ -146,7 +146,7 @@ itkFrequencyBandImageFilterTest( int argc, char* argv[] )
TRY_EXPECT_NO_EXCEPTION( stopBandFilter->Update() );

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage(stopBandFilter->GetOutput(), "StopBand" );
itk::ViewImage::View(stopBandFilter->GetOutput(), "StopBand" );
#endif

// Regression test
Expand Down Expand Up @@ -202,7 +202,7 @@ itkFrequencyBandImageFilterTest( int argc, char* argv[] )
TRY_EXPECT_NO_EXCEPTION( passBandFilter->Update() );

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( passBandFilter->GetOutput(), "PassBand - radians" );
itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - radians" );
#endif

// Test the non-radial cut-off.
Expand All @@ -217,7 +217,7 @@ itkFrequencyBandImageFilterTest( int argc, char* argv[] )
passBandFilter->Update();

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( passBandFilter->GetOutput(), "PassBand - RadialBandOff" );
itk::ViewImage::View( passBandFilter->GetOutput(), "PassBand - RadialBandOff" );
#endif

// Test with ShiftedIterator.
Expand All @@ -234,7 +234,7 @@ itkFrequencyBandImageFilterTest( int argc, char* argv[] )
passBandShiftedFilter->SetPassBand( passLowFreqThreshold, passHighFreqThreshold );
TRY_EXPECT_NO_EXCEPTION( passBandShiftedFilter->Update() );
#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( passBandShiftedFilter->GetOutput(), "PassBand - FrequencyShiftedIterator" );
itk::ViewImage::View( passBandShiftedFilter->GetOutput(), "PassBand - FrequencyShiftedIterator" );
#endif

// using WriterType = itk::ImageFileWriter< ImageType3D >;
Expand Down
10 changes: 5 additions & 5 deletions test/itkFrequencyExpandAndShrinkTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ runFrequencyExpandAndShrinkTest( const std::string & inputImage, const std::stri
// auto inverseFFTExpand2 = InverseFFTFilterType::New();
// inverseFFTExpand2->SetInput(expandViaInverseFFTFilter->GetOutput());
// inverseFFTExpand2->Update();
// itk::Testing::ViewImage(inverseFFTExpand1->GetOutput(), "Expand via frequency manipulation");
// itk::Testing::ViewImage(inverseFFTExpand2->GetOutput(), "Expand ViaInverseFFT");
// itk::ViewImage::View(inverseFFTExpand1->GetOutput(), "Expand via frequency manipulation");
// itk::ViewImage::View(inverseFFTExpand2->GetOutput(), "Expand ViaInverseFFT");
// #endif

/*********** SHRINK ***************/
Expand Down Expand Up @@ -171,8 +171,8 @@ runFrequencyExpandAndShrinkTest( const std::string & inputImage, const std::stri
inverseFFT2->Update();

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( zeroDCFilter->GetOutput(), "Original" );
itk::Testing::ViewImage( inverseFFT1->GetOutput(), "ExpandAndShrink via frequency manipulation" );
itk::ViewImage::View( zeroDCFilter->GetOutput(), "Original" );
itk::ViewImage::View( inverseFFT1->GetOutput(), "ExpandAndShrink via frequency manipulation" );
#endif

// Comparison
Expand All @@ -196,7 +196,7 @@ runFrequencyExpandAndShrinkTest( const std::string & inputImage, const std::stri

// Via inverseFFT and spatial domain manipulation.
#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( inverseFFT2->GetOutput(), "ExpandAndShrink ViaInverseFFT" );
itk::ViewImage::View( inverseFFT2->GetOutput(), "ExpandAndShrink ViaInverseFFT" );
#endif
differenceFilter->SetTestInput( inverseFFT2->GetOutput() );
differenceFilter->Update();
Expand Down
10 changes: 5 additions & 5 deletions test/itkFrequencyExpandTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,26 @@ runFrequencyExpandTest(const std::string & inputImage, const std::string & outpu
TRY_EXPECT_NO_EXCEPTION( writer->Update() );

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( zeroDCFilter->GetOutput(), "Original" );
itk::Testing::ViewImage( inverseFFT->GetOutput(), "FrequencyExpander" );
itk::ViewImage::View( zeroDCFilter->GetOutput(), "Original" );
itk::ViewImage::View( inverseFFT->GetOutput(), "FrequencyExpander" );
// Compare with regular expand filter.
using RegularExpandType = itk::ExpandWithZerosImageFilter< ImageType, ImageType >;
auto regularExpandFilter = RegularExpandType::New();
regularExpandFilter->SetInput( reader->GetOutput() );
regularExpandFilter->SetExpandFactors( 2 );
regularExpandFilter->Update();
itk::Testing::ViewImage( regularExpandFilter->GetOutput(), "Regular expander (adding zeros)" );
itk::ViewImage::View( regularExpandFilter->GetOutput(), "Regular expander (adding zeros)" );

// Complex to real
// using ComplexToRealFilter = itk::ComplexToRealImageFilter<ComplexImageType, ImageType>;
// auto complexToRealFilter = ComplexToRealFilter::New();
// complexToRealFilter->SetInput(fftFilter->GetOutput() );
// complexToRealFilter->Update();
// itk::Testing::ViewImage(complexToRealFilter->GetOutput());
// itk::ViewImage::View(complexToRealFilter->GetOutput());
// auto complexToRealFilterExpand = ComplexToRealFilter::New();
// complexToRealFilterExpand->SetInput(expandFilter->GetOutput() );
// complexToRealFilterExpand->Update();
// itk::Testing::ViewImage(complexToRealFilterExpand->GetOutput());
// itk::ViewImage::View(complexToRealFilterExpand->GetOutput());
#endif

if ( testPassed )
Expand Down
14 changes: 7 additions & 7 deletions test/itkFrequencyShrinkTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -322,37 +322,37 @@ runFrequencyShrinkTest( const std::string & inputImage, const std::string & outp
TRY_EXPECT_NO_EXCEPTION( writer->Update() );

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( zeroDCFilter->GetOutput(), "Original" );
itk::Testing::ViewImage( inverseFFT->GetOutput(), "FrequencyShrinker" );
itk::ViewImage::View( zeroDCFilter->GetOutput(), "Original" );
itk::ViewImage::View( inverseFFT->GetOutput(), "FrequencyShrinker" );
// Compare with regular shrink filter.
using RegularShrinkType = itk::ShrinkImageFilter< ImageType, ImageType >;
auto regularShrinkFilter = RegularShrinkType::New();
regularShrinkFilter->SetInput( zeroDCFilter->GetOutput() );
regularShrinkFilter->SetShrinkFactors( 2 );
regularShrinkFilter->Update();
itk::Testing::ViewImage( regularShrinkFilter->GetOutput(), "Regular shrinker" );
itk::ViewImage::View( regularShrinkFilter->GetOutput(), "Regular shrinker" );

// Complex to real
using ComplexToRealFilter = itk::ComplexToRealImageFilter< ComplexImageType, ImageType >;
auto complexToRealFilter = ComplexToRealFilter::New();
complexToRealFilter->SetInput( fftFilter->GetOutput() );
complexToRealFilter->Update();
itk::Testing::ViewImage( complexToRealFilter->GetOutput(), "ComplexToReal. Original" );
itk::ViewImage::View( complexToRealFilter->GetOutput(), "ComplexToReal. Original" );
auto complexToRealFilterShrink = ComplexToRealFilter::New();
complexToRealFilterShrink->SetInput( shrinkFilter->GetOutput() );
complexToRealFilterShrink->Update();
itk::Testing::ViewImage(complexToRealFilterShrink->GetOutput(), "ComplexToReal. Shrinked" );
itk::ViewImage::View(complexToRealFilterShrink->GetOutput(), "ComplexToReal. Shrinked" );

// Complex to imaginary
// using ComplexToImaginaryFilter = itk::ComplexToImaginaryImageFilter< ComplexImageType, ImageType >;
// auto complexToImaginaryFilter = ComplexToImaginaryFilter::New();
// complexToImaginaryFilter->SetInput( fftFilter->GetOutput() );
// complexToImaginaryFilter->Update();
// itk::Testing::ViewImage( complexToImaginaryFilter->GetOutput(), "ComplexToImaginary. Original" );
// itk::ViewImage::View( complexToImaginaryFilter->GetOutput(), "ComplexToImaginary. Original" );
// auto complexToImaginaryFilterShrink = ComplexToImaginaryFilter::New();
// complexToImaginaryFilterShrink->SetInput( shrinkFilter->GetOutput() );
// complexToImaginaryFilterShrink->Update();
// itk::Testing::ViewImage( complexToImaginaryFilterShrink->GetOutput(), "ComplexToImaginary. Shrinked" );
// itk::ViewImage::View( complexToImaginaryFilterShrink->GetOutput(), "ComplexToImaginary. Shrinked" );

#endif

Expand Down
2 changes: 1 addition & 1 deletion test/itkMonogenicSignalFrequencyImageFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ itkMonogenicSignalFrequencyImageFilterTest( int argc, char* argv[] )
inverseFFT->Update();
#ifdef ITK_VISUALIZE_TESTS
itk::NumberToString< unsigned int > n2s;
itk::Testing::ViewImage( inverseFFT->GetOutput(), "MonoFilterOutput (inverseFFT). Component: " + n2s(c) );
itk::ViewImage::View( inverseFFT->GetOutput(), "MonoFilterOutput (inverseFFT). Component: " + n2s(c) );
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion test/itkPhaseAnalysisSoftThresholdImageFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int itkPhaseAnalysisSoftThresholdImageFilterTest( int argc, char* argv[] )
phaseAnalyzer->GetOutputPhase();

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( cosPhase.GetPointer(), "PhaseAnalyzer(Soft) output" );
itk::ViewImage::View( cosPhase.GetPointer(), "PhaseAnalyzer(Soft) output" );
#endif

return testStatus;
Expand Down
4 changes: 2 additions & 2 deletions test/itkRieszFrequencyFilterBankGeneratorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ itkRieszFrequencyFilterBankGeneratorTest( int argc, char* argv[] )
complexToRealFilter->Update();
#ifdef ITK_VISUALIZE_TESTS
itk::NumberToString< unsigned int > n2s;
itk::Testing::ViewImage( complexToRealFilter->GetOutput(), "RealPart of Complex. Component: " + n2s(
itk::ViewImage::View( complexToRealFilter->GetOutput(), "RealPart of Complex. Component: " + n2s(
comp ) + " / " + n2s( filterBank->GetNumberOfOutputs() - 1 ) + ". Indices: " + oss.str() );
#endif
}
Expand All @@ -139,7 +139,7 @@ itkRieszFrequencyFilterBankGeneratorTest( int argc, char* argv[] )
complexToImaginaryFilter->Update();
#ifdef ITK_VISUALIZE_TESTS
itk::NumberToString< unsigned int > n2s;
itk::Testing::ViewImage( complexToImaginaryFilter->GetOutput(), "ImaginaryPart of Complex. Component: " + n2s(
itk::ViewImage::View( complexToImaginaryFilter->GetOutput(), "ImaginaryPart of Complex. Component: " + n2s(
comp ) + " / " + n2s( filterBank->GetNumberOfOutputs() - 1 ) + ". Indices: " + oss.str() );
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion test/itkRieszFrequencyFunctionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ runRieszFrequencyFunctionTest(unsigned int inputOrder)
//
// #ifdef ITK_VISUALIZE_TESTS
// itk::NumberToString< unsigned int > n2s;
// itk::Testing::ViewImage( complexToRealFilter->GetOutput(), "RealPart of Complex. Direction: " + n2s(
// itk::ViewImage::View( complexToRealFilter->GetOutput(), "RealPart of Complex. Direction: " + n2s(
// dir + 1) + " / " + n2s( ImageType::ImageDimension ) );
// #endif
}
Expand Down
8 changes: 4 additions & 4 deletions test/itkRieszWaveletPhaseAnalysisTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ runRieszWaveletPhaseAnalysisTest( const std::string& inputImage,
auto inverseFFT = InverseFFTFilterType::New();
inverseFFT->SetInput(analysisWavelets[i]);
inverseFFT->Update();
itk::Testing::ViewImage( inverseFFT->GetOutput(), "WaveletCoef: output #" + n2s(i) );
itk::ViewImage::View( inverseFFT->GetOutput(), "WaveletCoef: output #" + n2s(i) );
inverseFFT->SetInput(modifiedWavelets[i]);
inverseFFT->Update();
itk::Testing::ViewImage( inverseFFT->GetOutput(), "WaveletCoef. PhaseAnalyzed #" + n2s(i) );
itk::ViewImage::View( inverseFFT->GetOutput(), "WaveletCoef. PhaseAnalyzed #" + n2s(i) );
}
}
#endif
Expand All @@ -191,8 +191,8 @@ runRieszWaveletPhaseAnalysisTest( const std::string& inputImage,
inverseFFT->Update();

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( reader->GetOutput(), "Input Image" );
itk::Testing::ViewImage( inverseFFT->GetOutput(), "Inverse Wavelet" );
itk::ViewImage::View( reader->GetOutput(), "Input Image" );
itk::ViewImage::View( inverseFFT->GetOutput(), "Inverse Wavelet" );
#endif

// Cast To Float for save as tiff.
Expand Down
2 changes: 1 addition & 1 deletion test/itkShrinkDecimateImageFilterTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ runShrinkDecimateImageFilterTest()
}

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( decimator->GetOutput(), "ShrinkDecimate Output" );
itk::ViewImage::View( decimator->GetOutput(), "ShrinkDecimate Output" );
#endif

std::cout << "Test passed." << std::endl;
Expand Down
10 changes: 5 additions & 5 deletions test/itkStructureTensorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ runStructureTensorTest()
}

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( inputImage1.GetPointer(), "input1" );
itk::Testing::ViewImage( inputImage2.GetPointer(), "input2" );
itk::ViewImage::View( inputImage1.GetPointer(), "input1" );
itk::ViewImage::View( inputImage2.GetPointer(), "input2" );
#endif

// Structure Tensor
Expand Down Expand Up @@ -141,7 +141,7 @@ runStructureTensorTest()
<< eigenMatrixCols << std::endl;
}
#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( tensor->GetGaussianSource()->GetOutput(), "Gaussian" );
itk::ViewImage::View( tensor->GetGaussianSource()->GetOutput(), "Gaussian" );
#endif

typename ImageType::Pointer largestEigenValueProjectionImage;
Expand All @@ -156,12 +156,12 @@ runStructureTensorTest()

#ifdef ITK_VISUALIZE_TESTS
itk::NumberToString< float > n2s;
itk::Testing::ViewImage( projectImage.GetPointer(), "eigen number: " + n2s( eigenNumber ) );
itk::ViewImage::View( projectImage.GetPointer(), "eigen number: " + n2s( eigenNumber ) );
#endif
}
auto coherencyImage = tensor->ComputeCoherencyImage();
#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( coherencyImage.GetPointer(), "Coherency image" );
itk::ViewImage::View( coherencyImage.GetPointer(), "Coherency image" );
#endif

// Compare to known result
Expand Down
14 changes: 7 additions & 7 deletions test/itkStructureTensorWithGeneralizedRieszTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ runStructureTensorWithGeneralizedRieszTest(
if ( visualizeRieszWavelets )
{
itk::NumberToString< unsigned int > n2s;
itk::Testing::ViewImage( inverseFFT->GetOutput(),
itk::ViewImage::View( inverseFFT->GetOutput(),
"RieszWaveletCoef: output #" + n2s(i) + " RieszComp: " + n2s(rieszComp) );
}
bool visualizeRieszWaveletsInFrequency = false;
Expand All @@ -155,11 +155,11 @@ runStructureTensorWithGeneralizedRieszTest(
auto complexToImaginary = ComplexToImaginaryFilterType::New();
complexToReal->SetInput(rieszWavelets[rieszComp]);
complexToReal->Update();
itk::Testing::ViewImage( complexToReal->GetOutput(),
itk::ViewImage::View( complexToReal->GetOutput(),
"REAL:RieszWaveletCoef: output #" + n2s(i) + " RieszComp: " + n2s(rieszComp) );
complexToImaginary->SetInput(rieszWavelets[rieszComp]);
complexToImaginary->Update();
itk::Testing::ViewImage( complexToImaginary->GetOutput(),
itk::ViewImage::View( complexToImaginary->GetOutput(),
"IMAGINARY:RieszWaveletCoef: output #" + n2s(i) + " RieszComp: " + n2s(rieszComp) );
}
#endif
Expand Down Expand Up @@ -190,10 +190,10 @@ runStructureTensorWithGeneralizedRieszTest(
auto inverseFFT = InverseFFTFilterType::New();
inverseFFT->SetInput(analysisWavelets[i]);
inverseFFT->Update();
itk::Testing::ViewImage( inverseFFT->GetOutput(), "WaveletCoef: output #" + n2s(i) );
itk::ViewImage::View( inverseFFT->GetOutput(), "WaveletCoef: output #" + n2s(i) );
inverseFFT->SetInput(modifiedWavelets[i]);
inverseFFT->Update();
itk::Testing::ViewImage( inverseFFT->GetOutput(), "WaveletCoef. LargestComponentStructureTensor #" + n2s(i) );
itk::ViewImage::View( inverseFFT->GetOutput(), "WaveletCoef. LargestComponentStructureTensor #" + n2s(i) );
}
}
#endif
Expand All @@ -212,8 +212,8 @@ runStructureTensorWithGeneralizedRieszTest(
inverseFFT->Update();

#ifdef ITK_VISUALIZE_TESTS
itk::Testing::ViewImage( reader->GetOutput(), "Input Image" );
itk::Testing::ViewImage( inverseFFT->GetOutput(), "Inverse Wavelet" );
itk::ViewImage::View( reader->GetOutput(), "Input Image" );
itk::ViewImage::View( inverseFFT->GetOutput(), "Inverse Wavelet" );
#endif

// using WriterType = itk::ImageFileWriter< typename InverseFFTFilterType::OutputImageType >;
Expand Down
46 changes: 0 additions & 46 deletions test/itkViewImage.h

This file was deleted.

0 comments on commit 0f349fa

Please sign in to comment.