InsightSoftwareConsortium / ITKIsotropicWavelets

External Module for ITK, implementing Isotropic Wavelets and Riesz Filter for multiscale phase analysis.
Apache License 2.0
13 stars 11 forks source link

Check that algorithm is applied on image borders. #72

Closed phcerdan closed 6 years ago

phcerdan commented 6 years ago

CarrKbin1_1792_4x4x1_tile_1.nrrd.tar.gz

imageInfo:

Pixel Type is unsigned_char
numDimensions: 3
component size: 1
pixel type (string): scalar
pixel type: 1
NrrdImageIO (0x5632bbf59ec0)
  RTTI typeinfo:   itk::NrrdImageIO
  Reference Count: 1
  Modified Time: 190
  Debug: Off
  Object Name:
  Observers:
    none
  AbortGenerateData: Off
  Progress: 0
  FileName: /home/phc/repository_local/network-graph/results/Carrageenan/CarrKbin1_1792_4x4x1_tile_1.nrrd
  FileType: Binary
  ByteOrder: OrderNotApplicable
  IORegion:
    ImageIORegion (0x5632bbf59f58)
      Dimension: 2
      Index: 0 0
      Size: 0 0
  Number of Components/Pixel: 1
  Pixel Type: scalar
  Component Type: unsigned_char
  Dimensions: ( 448 448 64 )
  Origin: ( 89 89 14 )
  UseCompression: Off
  UseStreamedReading: Off
  UseStreamedWriting: Off
  ExpandRGBPalette: On
  IsReadAsScalarPlusPalette: False

Applying script (with any l or b, or applying soft threshold or not)

./rieszWaveletPhaseAnalysis -i $RESULTS/Carrageenan/CarrKbin1_1792_4x4x1_tile_1.nrrd -o $RESULTS/Carrageenan/Adenoised -d 3 -l 4 -b 4 -w Held --apply -v

Original: rieszvieworiginal

Inner: rieszviewinner

Border: rieszviewborder

phcerdan commented 6 years ago

Another check should be on BondaryConditions in the border.

phcerdan commented 6 years ago

Nah, nothing to worry. It was related to the phase analysis. We shouldn't apply phase analysis in the approx image, as Held originally pointed out.

  for ( unsigned int i = 0; i < forwardWavelet->GetNumberOfOutputs(); ++i )
    {
    std::cout << "Output #: " << i << " / " << numberOfOutputs - 1 << std::endl;
    ///  HERE
    if( i == numberOfOutputs - 1 ) // Held does not modify approx image, but it does not generate better results.
      {
      modifiedWavelets.push_back( analysisWavelets[i] );
      continue;
      }
    auto monoFilter = MonogenicSignalFrequencyFilterType::New();
    auto vecInverseFFT = VectorInverseFFTType::New();
    auto phaseAnalyzer = PhaseAnalysisFilter::New();
    auto fftForwardPhaseFilter = FFTForwardFilterType::New();

    // Generate a monogenic signal (vector valued)
    monoFilter->SetInput( analysisWavelets[i] );
    monoFilter->Update();

    vecInverseFFT->SetInput( monoFilter->GetOutput() );
    vecInverseFFT->Update();

    phaseAnalyzer->SetInput( vecInverseFFT->GetOutput() );
    phaseAnalyzer->SetApplySoftThreshold( applySoftThreshold );
    if (applySoftThreshold)
      {
      phaseAnalyzer->SetNumOfSigmas(thresholdNumOfSigmas);
      }
    phaseAnalyzer->Update();

    fftForwardPhaseFilter->SetInput( phaseAnalyzer->GetOutputCosPhase() );
    fftForwardPhaseFilter->Update();

    modifiedWavelets.push_back( fftForwardPhaseFilter->GetOutput() );
    modifiedWavelets.back()->DisconnectPipeline();
    }