Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
b45e75a
DOC: Setup project from ITKModuleTemplate
Besler Nov 13, 2017
80a0fa4
ENH: Added MaximumAbsoluteValueImageFilter from old repository
Besler Nov 15, 2017
9b5d20a
ENH: Added concept checks for Functor::MaximumAbsoluteValue, changed to
Besler Nov 15, 2017
b195f06
ENH: Wrote initial test for itkMaximumAbsoluteValueImageFilter, fixed
Besler Nov 16, 2017
0bfb37c
STYLE: Added documentation, transfered to ITK_DISALLOW_COPY_AND_ASSIG…
Besler Nov 16, 2017
46277c3
ENH: Added abstract class EigenvalueToScalarImageFilter
Besler Nov 16, 2017
85d0b4a
ENH: Added the MultiScaleHessianEnhancementImageFilter class with static
Besler Nov 16, 2017
61e7e02
STYLE: Renamed EigenvalueToScalarImageFilter to EigenToScalarImageFilter
Besler Nov 17, 2017
d3beb34
BUG: Fixed bad #endif preprocessor directive for ITK_USE_CONCEPT_CHEC…
Besler Nov 17, 2017
9f5cfd2
STYLE: Changed test cases to end in Test.cxx, put all test cases in one
Besler Nov 17, 2017
4172c4a
ENH: EigenvalueToScalarImageFilter no longer controlled by static member
Besler Nov 21, 2017
0bc6bf4
STYLE: Fixed left over TODO statement in itkMultiScaleHessianEnhancem…
Besler Nov 21, 2017
138d0a8
STYLE: Fixed redundant check for m_SigmaArray.GetSize()
Besler Nov 21, 2017
0a4a86e
BUG: Small casting error between SigmaType and SigmaStepsType fixed
Besler Nov 21, 2017
26294d2
ENH: MultiScaleHessianEnhancementImageFilter static methods now throw
Besler Nov 21, 2017
e72977b
BUG: Fixed division by zero error in static methods of
Besler Nov 21, 2017
0358dc0
ENH: Merge pull request #1 from Besler/enh/base
Besler Nov 21, 2017
aa7f4ab
BUG: Fixed error about setting eigenvalues
Besler Nov 28, 2017
bca397f
ENH: END: Added Krcah parameter estimation filter
Besler Nov 21, 2017
653959a
ENH: Completed the Krcah functor
Besler Nov 21, 2017
8f83ba5
STYLE: Changed Krcah parameter estimation to use process outputs, fix…
Besler Nov 27, 2017
f478190
ENH: Allow KrcahEigenToScalarFunctorImageFilter to accept decorated i…
Besler Nov 27, 2017
b5b917e
BUG: Fixed constructor in EigenToScalarImageFilter
Besler Nov 27, 2017
f19b39d
ENH: Implemented KrcahEigenToScalarImageFilter
Besler Nov 27, 2017
f9d94ce
BUG: Fixed error in rcahEigenToScalarFunctorImageFilter and
Besler Nov 27, 2017
a2b8b6a
ENH: Added Krcah preprocessing
Besler Nov 27, 2017
dae7f7c
BUG: Fixed implementation parameters to be correct
Besler Nov 28, 2017
48b9e5c
DOC: Enhanced documentation for Krcah methods and
Besler Nov 28, 2017
014b1e1
BUG: Fixed bug with the progress accumulator for
Besler Nov 28, 2017
c52e27d
BUG: Fixed bug where file names appear correct on local machine but i…
Besler Nov 28, 2017
4932a04
BUG: Fixed unit test for test/itkKrcahEigenToScalarParameterEstimatio…
Besler Nov 28, 2017
8beb531
BUG: Fixed EnlargeOutputRequestedRegion for
Besler Nov 29, 2017
ca2e24a
STYLE: Fixed naming from Forbenius norm to average trace of Krcah par…
Besler Nov 29, 2017
686679a
ENH: Merge pull request #2 from Besler/dev/krcah
Besler Dec 5, 2017
3ef4760
ENH: Completed Descoteaux parameter estimation
Besler Dec 6, 2017
14eae81
ENH: Implemented DescoteauxEigenToScalarFunctorImageFilter
Besler Dec 6, 2017
713c531
BUG: Replaced Math::sqr with sqrt
Besler Dec 6, 2017
21d88a2
ENH: Implemented DescoteauxEigenToScalarImageFilter
Besler Dec 6, 2017
324a123
ENH: Merge pull request #3 from Besler/dev/desco
Besler Dec 8, 2017
6800673
BUG: Fixed setters for KrcahEigenToScalarImageFilter to call Modified()
Besler Dec 9, 2017
8de140a
STYLE: Fixed ParameterEstimation to be const_correct
Besler Dec 9, 2017
2132c52
BUG: Fixed mask indexing bug from #4.
Besler Dec 9, 2017
506accb
ENH: Removed MinimalStandardRandomVariateGenerator and
Besler Dec 10, 2017
39dc50b
ENH: wrapped MaximumAbsoluteValueImageFilter, fixed no == or != opera…
Besler Dec 11, 2017
969ed52
ENH: Added MultiScaleHessianEnhancementImageFilter wrapping
Besler Dec 11, 2017
7d98f5c
ENH: Added DescoteauxEigenToScalarImageFilter wrapping
Besler Dec 11, 2017
86c05fe
ENH: Added KrcahEigenToScalarImageFilter wrapping
Besler Dec 11, 2017
dedfb85
BUG: Removed wrapping for EigenToScalarImageFilter since it is an abs…
Besler Dec 11, 2017
28999a5
BUG: Fixed Descoteaux and Krcah wrapping to use proper types
Besler Dec 11, 2017
c02b0d6
BUG: Use float for eigenpixel representation to support wrapping in
Besler Dec 11, 2017
06a5a03
ENH: Merge pull request #5 from Besler/bug/#4
Besler Dec 12, 2017
fa26a22
BUG: Fixed progress reporting bug in MultiScaleHessianEnhancementImag…
Besler Dec 12, 2017
2f28c8c
BUG: Explicit wrapping for KrcahEigenToScalarParameterEstimationImage…
Besler Dec 12, 2017
2910c6b
BUG: Fixed wrapping for all *EigenToScalarImageFilter classes
Besler Dec 12, 2017
ebc1536
BUG: Fixed double wrapping of EigenToScalarImageFilter
Besler Dec 12, 2017
f1959cd
BUG: Corrected GenerateInputRequestedRegion in
Besler Dec 13, 2017
221e94d
ENH: Wrapped KrcahEigenToScalarPreprocessingImageToImageFilter
Besler Dec 13, 2017
e3e0c08
ENH: Merge pull request #10 from Besler/dev/wrapping
Besler Dec 14, 2017
f88643d
ENH: Merge pull request #11 from Besler/dev/krcahpreproc
Besler Dec 14, 2017
7ff8342
ENH: Implemented HessianGaussianImageFilter with streaming
Besler Feb 2, 2018
ad44e4c
ENH: Implemented itkEigenToMeasureParameterEstimationFilter
Besler Feb 4, 2018
1f45ea3
ENH: Implemented DescoteauxEigenToMeasureParameterEstimationFilter
Besler Feb 4, 2018
d8c5fb5
DOC: Fixed naming for DescoteauxEigenToMeasureParameterFunctor
Besler Feb 7, 2018
45aedc7
BUG: Fixed initialization bug in HessianGaussianImageFilter
Besler Feb 7, 2018
4d59cc8
ENH: Added EigenToMeasureImageFilter and DescoteauxEigenToMeasureImag…
Besler Feb 7, 2018
7f7b88e
DOC: Added documentation to MaximumAbsoluteValue Functor
Besler Feb 7, 2018
a039b1a
ENH: Added ITKReview
Besler Feb 8, 2018
d415dac
ENH: Descoteaux implementation
Besler Feb 28, 2018
f7c50df
ENH: Move itkMultiScaleHessianEnhancementImageFilterStaticMethodsTest…
Besler Mar 3, 2018
457fd44
ENH: Move itkMaximumAbsoluteValueImageFilterTest to GTest
Besler Mar 4, 2018
4600876
ENH: Move itkHessianGaussianImageFilterTest to GTest
Besler Mar 4, 2018
eb3f81a
ENH: Remove ITKReview module
Besler Mar 5, 2018
e2e1d90
COMP: Remove deprecated throw specification
phcerdan Sep 24, 2018
5b83b02
ENH: TYLE: Prefer constexpr for const numeric literals
jhlegarreta Sep 27, 2018
c015a26
STYLE: Replace itkStaticConstMacro with static constexpr
jhlegarreta Sep 27, 2018
bc7a6b7
COMP: Use C++11 nullptr directly
jhlegarreta Sep 27, 2018
88d1be0
COMP: Use C++11 override directly
jhlegarreta Sep 27, 2018
050fcd3
COMP: Move ITK_DISALLOW_COPY_AND_ASSIGN calls to the public section.
jhlegarreta Sep 27, 2018
d37475b
BUG: BuG: Fix build errors and warnings.
jhlegarreta Sep 27, 2018
4eab00e
COMP: Merge pull request #6 from jhlegarreta/FixCompilerErrorsAndWarn…
jhlegarreta Sep 27, 2018
8ff4967
ENH: Merge pull request #7 from jhlegarreta/ConformToITKv5Changes
thewtex Oct 16, 2018
0a8b72b
ENH: Merge pull request #16 from InsightSoftwareConsortium/master
Besler Oct 16, 2018
f6fb4b9
STYLE: Use "typename" for template parameters
jhlegarreta Oct 16, 2018
a1a6e8a
STYLE: Prefer C++11 type alias over typedef.
jhlegarreta Oct 17, 2018
ba34169
ENH: Merge pull request #9 from jhlegarreta/UseTypenameKeywordConsist…
Besler Oct 17, 2018
86266c2
ENH: Merge pull request #10 from jhlegarreta/PreferC++1TypeAliasOverT…
Besler Oct 17, 2018
3d51d35
ENH: Merge pull request #17 from InsightSoftwareConsortium/master
Besler Oct 17, 2018
d2adab1
ENH: Merge pull request #15 from phcerdan/remove_throw_upstream
Besler Oct 17, 2018
0e0b6f6
ENH: Merge branch 'master' of github.com:InsightSoftwareConsortium/IT…
Besler Oct 17, 2018
3a5c1a6
ENH: Merge branch 'master' of github.com:Besler/ITKBoneEnhancement
Besler Oct 17, 2018
dfe056c
ENH: Update Descoteaux filter to ITKv5 DynamicThreadedGenerateData
Besler Oct 18, 2018
e1daf31
ENH: Implement Krcah parameter estimation filter and unit test
Besler Oct 19, 2018
3007f3d
ENH: Implemented HessianGaussianImageFilter with streaming
Besler Feb 2, 2018
c8512f3
ENH: Implemented itkEigenToMeasureParameterEstimationFilter
Besler Feb 4, 2018
e95e9b7
ENH: Implemented DescoteauxEigenToMeasureParameterEstimationFilter
Besler Feb 4, 2018
6908258
DOC: Fixed naming for DescoteauxEigenToMeasureParameterFunctor
Besler Feb 7, 2018
71e5281
BUG: Fixed initialization bug in HessianGaussianImageFilter
Besler Feb 7, 2018
fde7787
ENH: Added EigenToMeasureImageFilter and DescoteauxEigenToMeasureImag…
Besler Feb 7, 2018
0f2c5bc
DOC: Added documentation to MaximumAbsoluteValue Functor
Besler Feb 7, 2018
0d85346
ENH: Added ITKReview
Besler Feb 8, 2018
112aee1
ENH: Descoteaux implementation
Besler Feb 28, 2018
7324492
ENH: Move itkMultiScaleHessianEnhancementImageFilterStaticMethodsTest…
Besler Mar 3, 2018
f235743
ENH: Move itkMaximumAbsoluteValueImageFilterTest to GTest
Besler Mar 4, 2018
6262ab3
ENH: Move itkHessianGaussianImageFilterTest to GTest
Besler Mar 4, 2018
b898f6c
ENH: Update Descoteaux filter to ITKv5 DynamicThreadedGenerateData
Besler Oct 18, 2018
6778e78
ENH: Implement Krcah parameter estimation filter and unit test
Besler Oct 19, 2018
f02723d
ENH: Merge changes between master and dev/streamable_hessian
Besler Oct 29, 2018
e8f796a
STYLE: Prefer C++11 type alias over typedef.
Besler Oct 29, 2018
92f4698
STYLE: Use "typename" for template parameters
Besler Oct 29, 2018
53873f0
BUG: Fix Krcah implementation
Besler Oct 31, 2018
902d4d2
ENH: Remove SpatialObject parameterization
Besler Oct 31, 2018
b282eba
BUG: Follow templating of itkStreamableImageFilter for wrapping
Besler Nov 2, 2018
339c70b
COMP: Use directly std::exp instead of the wrapper vcl_exp
phcerdan Nov 19, 2018
b90e0db
COMP: Merge pull request #13 from phcerdan/use_stdexp_and_disable_thr…
thewtex Nov 19, 2018
8e19dc2
BUG: Disable DynamicMultiThreading in EigenToScalarParameterEstimation
phcerdan Nov 20, 2018
150104e
ENH: Merge pull request #14 from phcerdan/master
phcerdan Nov 20, 2018
99ed663
COMP: add ITK_ prefix to testing macros
dzenanz Oct 15, 2019
25fc0bb
COMP: Do not include itkExceptionObject.h directly
dzenanz Oct 15, 2019
616b491
COMP: fully qualify enumeration names
dzenanz Oct 15, 2019
3693635
COMP: rename GetNumberOfThreads into GetNumberOfWorkUnits
dzenanz Oct 15, 2019
40cb7b1
COMP: fix warnings -Winconsistent-missing-override
dzenanz Oct 15, 2019
7da2bdc
COMP: fix GCC -Wall warnings
dzenanz Oct 15, 2019
4d27bdc
ENH: update version numbers
dzenanz Oct 15, 2019
b303a90
ENH: Merge pull request #18 from dzenanz/master
thewtex Oct 15, 2019
c516b6a
ENH: Merge remote-tracking branch 'remotes/besler/dev/streamable_hess…
dzenanz Nov 19, 2019
6aa7e36
COMP: make it compile after the big merge
dzenanz Nov 19, 2019
a2287f4
BUG: fix Python wrapping
dzenanz Nov 19, 2019
caa4065
COMP: support running with legacy removed
dzenanz Nov 22, 2019
469fb0a
ENH: Merge pull request #20 from dzenanz/master
dzenanz Nov 25, 2019
0df83c8
ENH: removing unused files
dzenanz Nov 26, 2019
91ff1cf
ENH: parallelizing EigenToMeasureParameterEstimation filters
dzenanz Nov 26, 2019
65b654f
ENH: parallelize EigenToMeasure filter
dzenanz Nov 26, 2019
e127d9f
ENH: Merge pull request #22 from dzenanz/master
dzenanz Nov 27, 2019
2c72ac5
ENH: Add .gitattributes to allow running ITK clang-formatting scripts
hjmjohnson Feb 19, 2020
cfd7e72
ENH: Adding new scoped enumerations
mseng10 Dec 13, 2019
4308c0d
STYLE: Use override statements for C++11
hjmjohnson Feb 17, 2020
d456fe7
STYLE: Prefer = default to explicitly trivial implementations
hjmjohnson Feb 17, 2020
86a7e7e
STYLE: Remove redundant void argument lists
hjmjohnson Feb 17, 2020
5f89caa
STYLE: Use default member initialization
hjmjohnson Feb 17, 2020
4b56d3c
STYLE: Use auto for variable type matches the type of the initializer
hjmjohnson Feb 18, 2020
a162788
DOC: Update copyright assignment to NumFOCUS
hjmjohnson Feb 19, 2020
80c2f4e
ENH: Update enums from changes in ITK
mseng10 Feb 20, 2020
02a22d4
ENH: Fix unsigned/signed comparison warning.
hjmjohnson Feb 20, 2020
9733be9
COMP: Update GTest TYPED_TEST_CASE to TYPED_TEST_SUITE
thewtex Jun 25, 2020
c5d81ae
DOC: Add missing Doxygen \ingroup BoneEnhancement
thewtex Jun 25, 2020
1241f56
BUG: Remove ald Azure Pipelines configuration
thewtex Jun 25, 2020
2804815
BUG: Double parallelism in EigenToMeasureImageFilter
thewtex Jun 26, 2020
42c2f34
COMP: Update EigenValueOrder enum using declaration
thewtex Jun 26, 2020
00f1afb
BUG: Retain previous EigenToMeasureImageFilter
thewtex Jun 26, 2020
5670d2a
ENH: Merge pull request #25 from InsightSoftwareConsortium/itk-5.1
thewtex Jun 26, 2020
fb152bb
STYLE: Rename ITK_DISALLOW_COPY_AND_ASSIGN to ITK_DISALLOW_COPY_AND_MOVE
mseng10 Oct 16, 2020
e48e54e
ENH: Revert "ENH: Move itkHessianGaussianImageFilterTest to GTest"
dzenanz Mar 23, 2021
0867bb0
ENH: Revert "ENH: Move itkMaximumAbsoluteValueImageFilterTest to GTest"
dzenanz Mar 23, 2021
71faf56
ENH: Revert "ENH: Move itkMultiScaleHessianEnhancementImageFilterStat…
dzenanz Mar 23, 2021
07095df
STYLE: update style in the reverted code
dzenanz Mar 23, 2021
19aa677
BUG: disable unit tests which fail on CI but not locally
dzenanz Apr 2, 2021
b2b5045
ENH: Merge pull request #30 from dzenanz/master
thewtex Apr 5, 2021
099fc83
COMP: Tests depend on GTest
dzenanz Apr 8, 2021
754981e
COMP: Remove inclusion of .hxx files as headers
hjmjohnson Dec 17, 2021
b5645bb
ENH: Bump ITK and replace http with https using script
tbirdso May 31, 2022
44cedd6
STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassM…
hjmjohnson Jan 26, 2025
1f42b56
STYLE: Replace itkStaticConstMacro with static constexpr
hjmjohnson Jan 26, 2025
6cd9a17
COMP: Suppress -Wunused-parameter in HessianGaussianImageFilterTest
hjmjohnson Apr 24, 2026
f40766b
ENH: Ingest ITKBoneEnhancement into Modules/Filtering
hjmjohnson May 19, 2026
a3d00b4
COMP: Remove BoneEnhancement.remote.cmake and enable in configure-ci
hjmjohnson May 14, 2026
d2fd353
BUG: Forward image mask to EigenToMeasureImageFilter
hjmjohnson May 14, 2026
9a4365d
STYLE: Remove duplicate include of itkImageRegionSplitterSlowDimension.h
hjmjohnson May 14, 2026
793916e
STYLE: Remove commented-out region-crop dead code
hjmjohnson May 14, 2026
3e9e4c9
STYLE: Remove redundant ProgressAccumulator construction
hjmjohnson May 14, 2026
9794fe4
STYLE: Replace itkStaticConstMacro with static constexpr for ImageDim…
hjmjohnson May 14, 2026
33a4ce5
STYLE: Correct stale TODO about static methods and exceptions
hjmjohnson May 14, 2026
4d9d240
COMP: Remove stale standalone-build branch from CMakeLists
hjmjohnson May 14, 2026
6a6875f
DOC: Replace placeholder BoneEnhancement module description
hjmjohnson May 14, 2026
a6f7746
BUG: Disconnect per-scale response so scale-0 is not overwritten
hjmjohnson May 17, 2026
b14825d
COMP: Alphabetically sort Pixi-Cxx module list
hjmjohnson May 17, 2026
5db8a92
Merge remote-tracking branch 'upstream/main' into ingest-BoneEnhancement
hjmjohnson May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Modules/Filtering/BoneEnhancement/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project(BoneEnhancement)

itk_module_impl()
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/

#ifndef itkDescoteauxEigenToMeasureImageFilter_h
#define itkDescoteauxEigenToMeasureImageFilter_h

#include "itkEigenToMeasureImageFilter.h"
#include "itkMath.h"

namespace itk
{
/** \class DescoteauxEigenToMeasureImageFilter
* \brief Convert eigenvalues into a measure of sheetness according to the method of Descoteaux et al.
*
* Converts a 3D fixed array of eigenvalues into a measure of sheetness according to the method
* of Descoteaux et al. The parameters of the filter should be set using
* DescoteauxEigentoScalarParameterEstimationImageFilter.
*
* Computes the following equation for eigenvalues in a three dimensional fixed array:
* \f{eqnarray*}{
* R_{sheet} &=& \frac{|\lambda_2|}{\lambda_3|} \\
* R_{blob} &=& \frac{|2 |\lambda_3| - |\lambda_2| - |\lambda_1| |}{|\lambda_3|} \\
* R_{noise} &=& \sqrt{|\lambda_1|^2 + |\lambda_2|^2 + \lambda_3|^2} \\
* s &=& \exp\left(- \frac{R_{sheet}^2}{\alpha^2} \right) \left(1 - \exp\left(- \frac{R_{blob}^2}{\beta^2} \right)
* \right) \left(1 - \exp\left(- \frac{R_{noise}^2}{c^2} \right) \right) \f}
*
* Note that if \f$ \lambda_3 > 0 \f$, \f$ s = 0 \f$.
*
* \sa DescoteauxEigenToMeasureParameterEstimationFilter
* \sa EigenToMeasureImageFilter
* \sa MultiScaleHessianEnhancementImageFilter
*
* \author: Bryce Besler
* \ingroup BoneEnhancement
*/
template <typename TInputImage, typename TOutputImage>
class DescoteauxEigenToMeasureImageFilter : public EigenToMeasureImageFilter<TInputImage, TOutputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(DescoteauxEigenToMeasureImageFilter);

/** Standard Self typedef */
using Self = DescoteauxEigenToMeasureImageFilter;
using Superclass = EigenToMeasureImageFilter<TInputImage, TOutputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;

/** Input typedefs */
using InputImageType = typename Superclass::InputImageType;
using InputImagePixelType = typename Superclass::InputImagePixelType;
using InputImagePointer = typename Superclass::InputImagePointer;
using InputImageConstPointer = typename Superclass::InputImageConstPointer;
using InputImageRegionType = typename Superclass::InputImageRegionType;

/** Output typedefs */
using OutputImageType = typename Superclass::OutputImageType;
using OutputImagePointer = typename Superclass::OutputImagePointer;
using OutputImageRegionType = typename Superclass::OutputImageRegionType;
using OutputImagePixelType = typename Superclass::OutputImagePixelType;

/** Parameter typedefs */
using RealType = typename Superclass::RealType;
using ParameterArrayType = typename Superclass::ParameterArrayType;
using ParameterDecoratedType = typename Superclass::ParameterDecoratedType;

/** Method for creation through the object factory. */
itkNewMacro(Self);

/** Runtime information support. */
itkOverrideGetNameOfClassMacro(DescoteauxEigenToMeasureImageFilter);

/** Explicitely state the eigenvalues are ordered by magnitude for this filter */
typename Superclass::EigenValueOrderEnum
GetEigenValueOrder() const override
{
return Superclass::EigenValueOrderEnum::OrderByMagnitude;
}

/** Setter/Getter methods for setting Direction */
itkSetMacro(EnhanceType, RealType);
itkGetConstMacro(EnhanceType, RealType);
void
SetEnhanceBrightObjects()
{
SetEnhanceType(-1.0);
}
void
SetEnhanceDarkObjects()
{
SetEnhanceType(1.0);
}

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputHaveDimension3Check, (Concept::SameDimension<TInputImage::ImageDimension, 3u>));
itkConceptMacro(OutputHaveDimension3Check, (Concept::SameDimension<TOutputImage::ImageDimension, 3u>));
itkConceptMacro(InputFixedArrayHasDimension3Check, (Concept::SameDimension<TInputImage::PixelType::Dimension, 3u>));
// End concept checking
#endif
protected:
DescoteauxEigenToMeasureImageFilter();
~DescoteauxEigenToMeasureImageFilter() override = default;

OutputImagePixelType
ProcessPixel(const InputImagePixelType & pixel) override;

/** Check the input has the right number of parameters. */
void
BeforeThreadedGenerateData() override;

void
PrintSelf(std::ostream & os, Indent indent) const override;

private:
/* Member variables */
RealType m_EnhanceType;
}; // end class
} /* end namespace itk */

#ifndef ITK_MANUAL_INSTANTIATION
# include "itkDescoteauxEigenToMeasureImageFilter.hxx"
#endif

#endif /* itkDescoteauxEigenToMeasureImageFilter_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/

#ifndef itkDescoteauxEigenToMeasureImageFilter_hxx
#define itkDescoteauxEigenToMeasureImageFilter_hxx

#include "itkImageRegionConstIteratorWithIndex.h"
#include "itkImageRegionIterator.h"

namespace itk
{
template <typename TInputImage, typename TOutputImage>
DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::DescoteauxEigenToMeasureImageFilter()
: m_EnhanceType(-1.0)
{}

template <typename TInputImage, typename TOutputImage>
void
DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
{
ParameterArrayType parameters = this->GetParametersInput()->Get();
if (parameters.GetSize() != 3)
{
itkExceptionMacro(<< "Parameters must have size 3. Given array of size " << parameters.GetSize());
}
}

template <typename TInputImage, typename TOutputImage>
typename DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::OutputImagePixelType
DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::ProcessPixel(const InputImagePixelType & pixel)
{
/* Grab parameters */
ParameterArrayType parameters = this->GetParametersInput()->Get();
RealType alpha = parameters[0];
RealType beta = parameters[1];
RealType c = parameters[2];

/* Grab pixel values */
double sheetness = 0.0;
auto a1 = static_cast<double>(pixel[0]);
auto a2 = static_cast<double>(pixel[1]);
auto a3 = static_cast<double>(pixel[2]);
double l1 = itk::Math::abs(a1);
double l2 = itk::Math::abs(a2);
double l3 = itk::Math::abs(a3);

/* Deal with l3 > 0 */
if (m_EnhanceType * a3 < 0)
{
return static_cast<OutputImagePixelType>(0.0);
}

/* Avoid divisions by zero (or close to zero) */
if (l3 < Math::eps)
{
return static_cast<OutputImagePixelType>(0.0);
}

/* Compute measures */
const double Rsheet = l2 / l3;
const double Rblob = itk::Math::abs(2 * l3 - l2 - l1) / l3;
const double Rnoise = sqrt(l1 * l1 + l2 * l2 + l3 * l3);

/* Multiply together to get sheetness */
sheetness = 1.0;
sheetness *= std::exp(-(Rsheet * Rsheet) / (2 * alpha * alpha));
sheetness *= (1.0 - std::exp(-(Rblob * Rblob) / (2 * beta * beta)));
sheetness *= (1.0 - std::exp(-(Rnoise * Rnoise) / (2 * c * c)));

return static_cast<OutputImagePixelType>(sheetness);
}

template <typename TInputImage, typename TOutputImage>
void
DescoteauxEigenToMeasureImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << "Direction: " << GetEnhanceType() << std::endl;
}

} // namespace itk

#endif /* itkDescoteauxEigenToMeasureImageFilter_hxx */
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/

#ifndef itkDescoteauxEigenToMeasureParameterEstimationFilter_h
#define itkDescoteauxEigenToMeasureParameterEstimationFilter_h

#include "itkMath.h"
#include "itkEigenToMeasureParameterEstimationFilter.h"
#include <mutex>

namespace itk
{
/** \class DescoteauxEigenToMeasureParameterEstimationFilter
* \brief Automatic parameter estimation as defined by Descoteaux et al.
*
* The default parameters are:
* \f{eqnarray*}{
* \alpha &=& 0.5 \\
* \beta &=& 0.5 \\
* \gamma &=& 0.5 max\( Frobenius norm \)
* \f}
*
* Where the Frobenius norm for a real, symmetric matrix is given by
* the square root of the sum of squares of the eigenvalues.
*
* The parameters are estimated over the whole volume unless a mask is given.
* If a mask is given, parameters are evaluated only where IsInside returns
* true.
*
* \sa DescoteauxEigenToMeasureImageFilter
* \sa EigenToMeasureParameterEstimationFilter
* \sa MultiScaleHessianEnhancementImageFilter
*
* \author: Bryce Besler
* \ingroup BoneEnhancement
*/
template <typename TInputImage, typename TOutputImage = TInputImage>
class DescoteauxEigenToMeasureParameterEstimationFilter
: public EigenToMeasureParameterEstimationFilter<TInputImage, TOutputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(DescoteauxEigenToMeasureParameterEstimationFilter);

/** Standard Self typedef */
using Self = DescoteauxEigenToMeasureParameterEstimationFilter;
using Superclass = EigenToMeasureParameterEstimationFilter<TInputImage, TOutputImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;

/** Input typedefs */
using InputImageType = typename Superclass::InputImageType;
using InputImagePointer = typename Superclass::InputImagePointer;
using InputImageConstPointer = typename Superclass::InputImageConstPointer;
using InputImageRegionType = typename Superclass::InputImageRegionType;
using InputImagePixelType = typename Superclass::InputImagePixelType;
using PixelValueType = typename Superclass::PixelValueType;

/** Output typedefs */
using OutputImageType = typename Superclass::OutputImageType;
using OutputImageRegionType = typename Superclass::OutputImageRegionType;
using OutputImagePixelType = typename Superclass::OutputImagePixelType;

/** Input Mask typedefs. */
using MaskSpatialObjectType = typename Superclass::MaskSpatialObjectType;
using MaskSpatialObjectTypeConstPointer = typename Superclass::MaskSpatialObjectTypeConstPointer;

/** Parameter typedefs */
using RealType = typename Superclass::RealType;
using ParameterArrayType = typename Superclass::ParameterArrayType;
using ParameterDecoratedType = typename Superclass::ParameterDecoratedType;

/** Method for creation through the object factory. */
itkNewMacro(Self);

/** Runtime information support. */
itkOverrideGetNameOfClassMacro(DescoteauxEigenToMeasureParameterEstimationFilter);

/** Setter/Getter methods for setting FrobeniusNormWeight */
itkSetMacro(FrobeniusNormWeight, RealType);
itkGetConstMacro(FrobeniusNormWeight, RealType);

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputHaveDimension3Check, (Concept::SameDimension<TInputImage::ImageDimension, 3u>));
itkConceptMacro(InputFixedArrayHasDimension3Check, (Concept::SameDimension<TInputImage::PixelType::Dimension, 3u>));
// End concept checking
#endif
protected:
DescoteauxEigenToMeasureParameterEstimationFilter();
~DescoteauxEigenToMeasureParameterEstimationFilter() override = default;

/** Initialize some accumulators before the threads run. */
void
BeforeThreadedGenerateData() override;

/** Do final mean and variance computation from data accumulated in threads. */
void
AfterThreadedGenerateData() override;

/** Multi-thread version GenerateData. */
void
DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;

inline RealType
CalculateFrobeniusNorm(const InputImagePixelType & pixel) const;

void
PrintSelf(std::ostream & os, Indent indent) const override;

private:
/* Member variables */
RealType m_FrobeniusNormWeight;
RealType m_MaxFrobeniusNorm;

std::mutex m_Mutex;
}; // end class
} // namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
# include "itkDescoteauxEigenToMeasureParameterEstimationFilter.hxx"
#endif

#endif /* itkDescoteauxEigenToMeasureParameterEstimationFilter_h */
Loading
Loading