-
-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: automatic threshold calculators
This is the code of the insight journal contribution "Histogram-based thresholding - some missing methods". http://www.insight-journal.org/browse/publication/811 http://hdl.handle.net/10380/3279 The Otsu filters and calculators have also been modified to use the architecture of the other calculators. The histogram is no more computed by the calculator. This is delegated to another filter, such as ImageToHistogramFilter. This change lets us easily implementing the multithreading and the ability to mask the image to compute the histogram, for example by using MaskedImageToHistogramFilter or by using the histogram attached to a LabelObject. The old OtsuThresholdImageCalculator is available in the ITKV3Compatibility module. Patch 15 - Changed itkTypeMacro superclass field from ImageToImageFilter to HistogramThresholdImageFilter in all subclasses Removed some redundant include files added methods for setting number of histogram bins and turning AutoMinimumMaximum on/off. Still need methods for setting minimum and maximum explicitly. Not sure of the appropriate way of doing this with the decorator structures. Added required number of inputs and outputs. Patch 16 - Rebased after the removal of the Testing/Data submodule. Patch 17 - Added my (Richard Beare) complete affiliation. Also changed the strategy for derived classes that include calculators with different parameters. This change is intended for discussion. I have removed the virtual method - ConfigureCalculator - and included a pointer to the calculator in the derived class. This eliminated dynamic_casts inside the derived class as well as the local variables in the derived class. However it leads to the need for explicit Set/Get methods, rather than ones created using macros. Perhaps there are macros that can help that I am unaware of? The example is the Intermodes filter. Note - we also need a new test for intermodes filter using SetUseInterMode(false) Change-Id: I697873136fbca86258626284eae5df7b552c6241
- Loading branch information
1 parent
764f5ee
commit fb95a5e
Showing
109 changed files
with
5,841 additions
and
249 deletions.
There are no files selected for viewing
221 changes: 221 additions & 0 deletions
221
Documentation/Migration/OtsuCalculatorAndFilterNormalization.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE Change SYSTEM "http://ij.itk.org/itkfaq/ITKMigration.dtd"> | ||
|
||
<!--** | ||
** | ||
** OtsuCalculatorAndFilterNormalization.xml | ||
** | ||
** >>>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
** THIS FILE HAS BEEN AUTOMATICALLY GENERATED. EDIT IT BEFORE COMMITING | ||
** <<<<<<<<<<<<<<<<<<<<<<<<<<< | ||
** | ||
** Please, make sure this file validates the following w3c test before committing it: http://validator.w3.org | ||
**--> | ||
<Change> | ||
<!--** | ||
** Title for the online migration page | ||
**--> | ||
<Title> | ||
Otsu Calculator And Filter Normalization | ||
</Title> | ||
|
||
<!--** | ||
** The author of the change | ||
**--> | ||
<Author> | ||
Gaëtan Lehmann | ||
</Author> | ||
|
||
<!--** | ||
** Date of creation for the XML document | ||
**--> | ||
<Date> | ||
2011-09-05 | ||
</Date> | ||
|
||
<!--** | ||
** Plain text description of the change | ||
** Extracted from git commit messages | ||
**--> | ||
<Description> | ||
<![CDATA[ | ||
The Otsu filters and calculators have been modified to use the | ||
architecture of the other threshold calculators. | ||
The histogram is no more computed by the calculator; it is delegated | ||
to another filter, such as ImageToHistogramFilter. As a consequence, the template | ||
parameter used for the Otsu calculator is the histogram type. | ||
The Otsu filter is using the usual maximum pixel value inside the objects and the minimum | ||
pixel values outside the objects. The values were swapped before this change. | ||
The Otsu filter doesn't let the user choose the number of bins in the histogram anymore. | ||
This choice is delegated to the ImageToHistogramFilter used internally, and is available | ||
by reconstructing the minipipeline | ||
ImageToHistogramFilter -> OtsuThresholdCalculator -> BinaryThresholdImageFilter. | ||
]]> | ||
</Description> | ||
|
||
<!--** | ||
** Sample code snippets | ||
** Extracted from git diff of changed files in Examples and Testing | ||
**--> | ||
<SampleCode> | ||
<Old> | ||
<![CDATA[ | ||
]]> | ||
</Old> | ||
|
||
<New> | ||
<![CDATA[ | ||
]]> | ||
</New> | ||
|
||
</SampleCode> | ||
|
||
<!--** | ||
** The change-ids for all commits in the topic branch | ||
**--> | ||
<Gerrit-ChangeId> | ||
I697873136fbca86258626284eae5df7b552c6241 | ||
</Gerrit-ChangeId> | ||
|
||
<!--** | ||
** List of all changed files from the topic branch | ||
**--> | ||
<FileList> | ||
Modules/Filtering/Thresholding/include/itkHuangThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkHuangThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkHuangThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkHuangThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkIntermodesThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkIntermodesThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkIntermodesThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkIsoDataThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkIsoDataThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkIsoDataThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkIsoDataThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkKittlerIllingworthThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkKittlerIllingworthThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkKittlerIllingworthThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkKittlerIllingworthThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkLiThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkLiThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkMomentsThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkMomentsThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdImageCalculator.h | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdImageCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkOtsuThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkShanbhagThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkShanbhagThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkTriangleThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkTriangleThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkTriangleThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkTriangleThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/include/itkYenThresholdCalculator.h | ||
Modules/Filtering/Thresholding/include/itkYenThresholdCalculator.hxx | ||
Modules/Filtering/Thresholding/include/itkYenThresholdImageFilter.h | ||
Modules/Filtering/Thresholding/include/itkYenThresholdImageFilter.hxx | ||
Modules/Filtering/Thresholding/test/Baseline/itkHuangThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkIntermodesThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkIsoDataThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkKittlerIllingworthThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkLiThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkMaximumEntropyThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkMomentsThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkOtsuThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkRenyiEntropyThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkShanbhagThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkTriangleThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/Baseline/itkYenThresholdImageFilterTest.png.md5 | ||
Modules/Filtering/Thresholding/test/CMakeLists.txt | ||
Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkOtsuThresholdImageCalculatorTest.cxx | ||
Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkTriangleThresholdImageFilterTest.cxx | ||
Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx | ||
Modules/Nonunit/IntegratedTest/test/itkAlgorithmsPrintTest2.cxx | ||
Modules/Nonunit/Review/test/itkN4MRIBiasFieldCorrectionImageFilterTest.cxx | ||
Modules/Numerics/Statistics/include/itkHistogram.h | ||
Modules/Numerics/Statistics/include/itkHistogram.hxx | ||
Modules/Numerics/Statistics/include/itkImageToHistogramFilter.hxx | ||
Wrapping/WrapITK/Libraries/ITKThresholding/CMakeLists.txt | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkHuangThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkHuangThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkIntermodesThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkIntermodesThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkIsoDataThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkIsoDataThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkKittlerIllingworthThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkKittlerIllingworthThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkLiThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkLiThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkMaximumEntropyThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkMaximumEntropyThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkMomentsThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkMomentsThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkOtsuThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkOtsuThresholdImageCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkOtsuThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkRenyiEntropyThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkRenyiEntropyThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkShanbhagThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkShanbhagThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkTriangleThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkTriangleThresholdImageFilter.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkYenThresholdCalculator.wrap | ||
Wrapping/WrapITK/Libraries/ITKThresholding/itkYenThresholdImageFilter.wrap | ||
</FileList> | ||
|
||
<!--** | ||
** If the migration can be accomplished by a simple string | ||
** substitution, then use the following construct to define | ||
** the substitution rule. | ||
** | ||
** <MigrationFix-Automatic> | ||
** <Old> | ||
** <![CDATA[MipsleledName]]> | ||
** </Old> | ||
** <New> | ||
** <![CDATA[MisspelledName]]> | ||
** </New> | ||
** </MigrationFix-Automatic> | ||
**--> | ||
|
||
<!--** | ||
** If the migration can NOT be accomplished by a simple string | ||
** substitution, but potential problem spots can be identified, | ||
** use the following construct to define a migration flag rule. | ||
** | ||
** <MigrationFix-Manual> | ||
** OldFunctionName | ||
** </MigrationFix-Manual> | ||
**--> | ||
|
||
</Change> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.