Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 47 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
# .pre-commit-config.yaml
# for details see https://pre-commit.com
#
# No hooks are configured on this branch. This empty file prevents
# pre-commit from erroring when backporting commits after pre-commit
# hooks have been configured.

repos: []
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=200']
exclude: |
(
Source/DataDictionary/gdcmPrivateDefaultDicts.cxx|
Documentation/watershed.ps
)
- id: check-ast
exclude: "\\/ThirdParty\\/"
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-json
exclude: "\\/ThirdParty\\/"
- id: check-merge-conflict
exclude: "\\/ThirdParty\\/"
args: ['--assume-in-merge']
- id: check-toml
exclude: "\\/ThirdParty\\/"
- id: check-vcs-permalinks
exclude: "\\/ThirdParty\\/"
- id: check-xml
exclude: "\\/ThirdParty\\/"
- id: check-yaml
exclude: "\\/ThirdParty\\/"
- id: check-shebang-scripts-are-executable
exclude: "\\/ThirdParty\\/"
- id: debug-statements
exclude: "\\/ThirdParty\\/"
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: "\\.(md5|sha|sha512|svg|vtk|vtp)$|^Resources\\/[^\\/]+\\.h$|\\/ColorFiles\\/.+\\.txt$|Data\\/Input\\/.+$|\\/ThirdParty\\/|\\/Data\\/"
- id: forbid-new-submodules
- id: forbid-submodules
- id: mixed-line-ending
exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/"
- id: name-tests-test
exclude: "\\/ThirdParty\\/"
args: ['--pytest-test-first']
- id: no-commit-to-branch
args: ['--branch','dashboard','--branch','python-builds','--branch','release','--branch','hooks','--branch', 'main','--branch','main','--pattern','release-*']
- id: trailing-whitespace
exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/"
2 changes: 1 addition & 1 deletion CMake/ITKSetStandardCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function(check_avx_flags avx_flags_var)
endfunction()

# Check for the presence of SSE2.
# Adapted from the AVX check and https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_platform_tests.cxx#L164-L178
# Adapted from the AVX check and https://github.com/InsightSoftwareConsortium/ITK/blob/e7db79dca282ce8001e9456d1e5b51fe31de48c5/Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_platform_tests.cxx#L164-L178
function(check_sse2_flags sse2_flags_var)

# set flags to be used in check_cxx_source_runs below
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Doxygen/ImageSimilarityMetrics.dox
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**

\page ImageSimilarityMetricsPage Image Similarity Metrics
\section MetricsIntroduction Introduction

\section MetricsIntroduction Introduction

It is a common task in image analysis to require to compare how
similar two image might be. This comparison may be limited to a
Expand All @@ -23,7 +23,7 @@ in a toolkit. You need a set of them because none is able to perform
the same job as the other.

The following table presents a comparison between image similarity
metrics. This is by no means an exhaustive comparison but will at
metrics. This is by no means an exhaustive comparison but will at
least provide some guidance as to what metric can be appropiated for
particular problems.

Expand Down
1 change: 0 additions & 1 deletion Documentation/Doxygen/Iterators.dox
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,3 @@


*/

1 change: 0 additions & 1 deletion Documentation/Doxygen/MainPage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@
* iterators.
*
*/

42 changes: 21 additions & 21 deletions Documentation/Doxygen/NeighborhoodIterators.dox
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This document provides a general overview of the intended use of the
NeighborhoodIterator classes and their associated objects for low-level image
processing in Itk. For a more detailed description of the API, please refer to
the inline Itk documentation and manual.
the inline Itk documentation and manual.

\par
Neighborhood iterators are the abstraction of the concept of \em locality in
Expand All @@ -25,16 +25,16 @@ This code in classical \em texbook notation can look like:
int nx = 512;
int ny = 512;
ImageType image(nx,ny);
for(int x=1; x<nx-1; x++)
for(int x=1; x<nx-1; x++)
{
float sum = 0;
for(int y=1; y<ny-1; y++)
for(int y=1; y<ny-1; y++)
{
sum += image(x-1,y-1) + image(x ,y-1) + image(x+1,y-1);
sum += image(x-1,y ) + image(x ,y ) + image(x+1,y );
sum += image(x-1,y+1) + image(x ,y+1) + image(x+1,y+1);
}
}
}
\endcode

\par
Expand All @@ -45,7 +45,7 @@ by using iterators to dereference pixels, and for a two-dimensional image,
code-readability may not suffer much. But what if we want code for three
or more dimensions? Before long, the code size and complexity will increase to
unmanageable levels. In Itk, we have encapsulated this functionality for
efficiency, readability, and reusability.
efficiency, readability, and reusability.

\section NeighborhoodIteratorsSection Neighborhood iterators
itk::Image neighborhood iteration and dereferencing is encapsulated in the
Expand Down Expand Up @@ -77,7 +77,7 @@ have been omitted for clarity. )
10 for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) radius[i] = 1;
11
12 // Initializes the iterators on the input & output image regions
13 NeighborhoodIterator it(radius, input_image,
13 NeighborhoodIterator it(radius, input_image,
14 output_image->GetRequestedRegion());
15 ImageIterator out(output_image, output_image->GetRequestedRegion());
16
Expand All @@ -86,32 +86,32 @@ have been omitted for clarity. )
19 {
20 float accum = 0.0;
21 for (unsigned int i = 0; i < it.Size(); ++i)
22 {
23 accum += it.GetPixel(i);
22 {
23 accum += it.GetPixel(i);
24 }
25 out.Set(accum/(float)(it.Size()));
26 }
\endcode

\par
\par
Note that the computational work is confined to lines 18-26. The code is also
completely generalized for multiple dimensions. For example, changing line 1
to:
\code
1 using ImageType = itk::Image<float, 5>;
\endcode
produces an averaging filter for five-dimensional images.
produces an averaging filter for five-dimensional images.

\par
The values in the neighborhood are dereferenced through the GetPixel(n) method
of the iterator. Think of the iterator as a C array, storing neighborhood
of the iterator. Think of the iterator as a C array, storing neighborhood
values in the same order that they are stored in the image, with the lowest
dimension as the fastest increasing dimension.

\section OperatorsOperationsSection Neighborhood operators and operations
NeighborhoodOperators are container classes for generating and storing
computational kernels such as LaPlacian, Gaussian, derivative, and
morphological operators. They provide a generalized interface for creation and
morphological operators. They provide a generalized interface for creation and
access of the operator coefficients.

\par
Expand All @@ -129,7 +129,7 @@ demonstrates this concept.
4 NeighborhoodInnerProduct IP;
5
6 out = out.Begin();
7 for (it.SetToBegin(); it != it.End(); ++it, ++out)
7 for (it.SetToBegin(); it != it.End(); ++it, ++out)
8 {
9 out.Set( IP( it, OP) );
10 }
Expand All @@ -144,7 +144,7 @@ operator/operation model. The mean calculation above is one example. A
1 NeighborhoodIterator::RadiusType radius = {1, 0, 0};
2 NeighborhoodIterator it(radius, inputImage, regionToProcess)
3 ImageRegionIterator out( outputImage, regionToProcess );
4 for (it.SetToBegin(); it != it.End(); ++it, ++out)
4 for (it.SetToBegin(); it != it.End(); ++it, ++out)
5 {
6 out.Set( it.GetPixel(3) - it.GetPixel(2) );
7 }
Expand All @@ -155,7 +155,7 @@ In this example the neighborhood is defined as a three pixel strip
with width along only the first axis. Mapping
the spatial orientation of neighborhood pixels to the array location is the
responsibility of the code writer. Some methods such as GetStride(n), which
returns the stride length in pixels along an axis n, have been provided to help
returns the stride length in pixels along an axis n, have been provided to help
in coding algorithms for arbitrary dimensionality. The index of the center
pixel in a neighborhood is always Size()/2.

Expand All @@ -171,17 +171,17 @@ is appropriate for their algorithm.
\par
A SmartNeighborhoodIterator can be used in place of NeighborhoodIterator to
iterate over an entire image region, but it will incur a penalty on
performance. For this reason, it is desirable to process the image differently
performance. For this reason, it is desirable to process the image differently
over distinct boundary and non-boundary regions. Itk's definition of image regions
makes this easy to manage. The process is as follows: first apply the
algorithm over all neighborhoods not on the image boundary using the fast
NeighborhoodIterator, then process each region on the boundary using the
SmartNeighborhoodIterator. The size of the boundary regions are defined by the
SmartNeighborhoodIterator. The size of the boundary regions are defined by the
radius of the neighborhood that you are using.

\par
Rewriting the inner product code using this approach looks like the following.
(Here we are using the default SmartNeighborhoodIterator boundary condition and
(Here we are using the default SmartNeighborhoodIterator boundary condition and
omitting some template parameters for simplicity.)

\code
Expand All @@ -205,7 +205,7 @@ out = ImageIterator(outputImage, *regions_iterator);
NeighborhoodIterator it (OP.GetRadius(), inputImage, *regions_iterator);
NeighborhoodInnerProduct IP;
out = out.Begin();
for (it.SetToBegin(); it != it.End(); ++it, ++out)
for (it.SetToBegin(); it != it.End(); ++it, ++out)
{
out.Set( IP( it, OP) );
}
Expand All @@ -219,7 +219,7 @@ for (regions_iterator++ ; regions_iterator != regions.end(); regions_iterator++)
{
out = ImageIterator(outputImage, *regions_iterator);
sit = SmartNeighborhoodIterator(OP.GetRadius(), inputImage, *regions_iterator);
for (sit.SetToBegin(); sit != sit.End(); ++sit, ++out)
for (sit.SetToBegin(); sit != sit.End(); ++sit, ++out)
{
out.Set( SIP( sit, OP) );
}
Expand All @@ -242,7 +242,7 @@ AnisotropicDiffusionFunctions and the morphological image filters.
itk::WatershedSegmenter also makes extensive use of the neighborhood
iterators.

\par
\par
The best documentation of the API for these objects is are the class
definitions themselves, since the API is subject to change as the toolkit
matures and is refined.
Expand Down
12 changes: 6 additions & 6 deletions Documentation/Doxygen/Registration.dox
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**

\page RegistrationPage Registration Techniques

\section RegistrationIntroduction Introduction

\b Registration is a technique aimed to align two objects using a
\section RegistrationIntroduction Introduction

\b Registration is a technique aimed to align two objects using a
particular transformation.

A typical example of registration is to have two medical images
Expand All @@ -15,15 +15,15 @@ a spatial transformation to find the corresponding pixel from one
image into the other.

Another typical example of registration is to have a geometrical model
of an organ, let's say a bone. This model can be used to find the
of an organ, let's say a bone. This model can be used to find the
corresponding structure in a medical image. In this case, a spatial
transformation is needed to find the correct location of the structure
in the image.


\section RegistrationFramework ITK Registration Framework

The Insight Toolkit takes full advantage of the power provided by
The Insight Toolkit takes full advantage of the power provided by
generic programming. Thanks to that, it have been possible to create
an abstraction of the particular problems that the toolkit is intended
to solve.
Expand Down Expand Up @@ -105,6 +105,6 @@ The evaluation of a metric can be very expensive in computing time. An approach

It is usual to create first a sequence of reduced resolution version of the objects, this set of objects is called a <em> pryramid representation </em>. A Multiresolution method is basically a set of consecutive registration process, each one performed at a particular level of the pyramid, and using as initial transform the resulting transform of the previous process.

Multiresolution offers the double advantage of increasing performance and at the same time improving the stability of the optimization by smoothing out local minima and increasing the capture region of the process.
Multiresolution offers the double advantage of increasing performance and at the same time improving the stability of the optimization by smoothing out local minima and increasing the capture region of the process.

*/
2 changes: 1 addition & 1 deletion Documentation/Doxygen/Streaming.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
\page StreamingPage Streaming

\section StreamingIntroduction Introduction

\image html Streaming.gif "Pipelines can be set up to stream data through filters in small pieces."


Expand Down
10 changes: 5 additions & 5 deletions Documentation/Doxygen/Threading.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
\page ThreadingPage Threading

\section ThreadingIntroduction Introduction

ITK is designed to run in multiprocessor environments. Many of
ITK's filters are multithreaded. When a multithreading filter
executes, it automatically divides the work amongst multiprocessors
Expand All @@ -15,7 +15,7 @@
\image html Threading.gif "Filters may process their data in multiple threads in a shared memory configuration."

\section FilterThreadSafety Filter Level Multithreading

A multithreaded filter provides an implementation of the
ThreadedGenerateData() method (see
itk::ImageSource::ThreadedGenerateData()) as opposed to the
Expand All @@ -41,7 +41,7 @@
the threads write to this same block of memory but a given thread
is only allowed to set specific pixels.

\subsection FilterMemoryAllocation Memory Management
\subsection FilterMemoryAllocation Memory Management

The GenerateData() method is responsible for allocation the output
bulk data. For an image processing filter, this corresponds to
Expand Down Expand Up @@ -76,10 +76,10 @@

ITK is designed so that different instances of the same class can be
accessed in different execution threads. But multiple threads should
not attempt to modify a single instance. This granularity of thread
not attempt to modify a single instance. This granularity of thread
safety was chosen as a compromise between performance and flexibility.
If we allow ITK objects to be modified in multiple threads then ITK
would have to mutex every access to every instance variable of a
would have to mutex every access to every instance variable of a
class. This would severely affect performance.

\section NumericsThreadSafety Thread Safety in the Numerics Library
Expand Down
2 changes: 1 addition & 1 deletion Documentation/docs/_static/icon/html_head_content.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<link rel="shortcut icon" href="icon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="icon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<meta name="theme-color" content="#ffffff">
1 change: 0 additions & 1 deletion Documentation/docs/releases/5.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1801,4 +1801,3 @@ Remote Module Changes Since v5.2rc03
#### Style Changes

- Move notebooks into examples/ directory directly ([d8ebede](https://github.com/KitwareMedical/ITKUltrasound/commit/d8ebede))

4 changes: 2 additions & 2 deletions Documentation/docs/releases/5.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Unpack optional testing data in the same directory where the Library Source is u
- Add `itk::Copy(const T & original)`, which simply returns a copy
- Make `itk::ImageRegion` trivially copyable, remove inheritance (FUTURE)
- `itk::VTKPolyDataMeshIO` support for reading VTK 5.1 format
- Add `ITK_DEFAULT_COPY_AND_MOVE(TypeName)` macro definition
- Add `ITK_DEFAULT_COPY_AND_MOVE(TypeName)` macro definition
- Replace `(const std::string)` casts with C++17 `std::string_view`
- Replace SetSize/Index calls in tests with `region{ index, size }`
- Optionally limit an `ImageMask` to a specific pixel value
Expand Down Expand Up @@ -229,7 +229,7 @@ We extend our gratitude to all the ITK community members who have contributed to
🗣️ What's Next
---------------

ITK 5.4.0 represents a transformative milestone in our documentation journey. The finalization of 5.4.0 was delayed due to dependency issues in the example documentation's infrastructure. While these are addressed, we'll continue to refine the 5.4 series through patch releases. We're excited to eventually migrate the examples to a similar robust foundation in future innovations.
ITK 5.4.0 represents a transformative milestone in our documentation journey. The finalization of 5.4.0 was delayed due to dependency issues in the example documentation's infrastructure. While these are addressed, we'll continue to refine the 5.4 series through patch releases. We're excited to eventually migrate the examples to a similar robust foundation in future innovations.

Looking ahead, we're thrilled to announce that ITK 6, our next major release, will showcase a substantial array of modernizations. The community has been hard at work implementing significant improvements that will elevate development with and on the toolkit. Watch for upcoming alpha and beta releases of ITK 6, which will run parallel to our 5.4 maintenance efforts.

Expand Down
1 change: 0 additions & 1 deletion Documentation/docs/releases/5.4.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,3 @@ Remote Module Changes Since v5.4.0
#### Bug Fixes

- Bump Python package version for re-deploy ([9f6654d](https://github.com/InsightSoftwareConsortium/ITKTotalVariation/commit/9f6654d))

1 change: 0 additions & 1 deletion Documentation/docs/releases/5.4.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,3 @@ We remain dedicated to supporting current users through:
#### Bug Fixes

- Fix imread with single-element list and add test ([8480b5f6d3](https://github.com/InsightSoftwareConsortium/ITK/commit/8480b5f6d3))

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
*
*=========================================================================*/
#import "itkBasicFiltersHeaderTest.cxx"


Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@
*
*=========================================================================*/
#import "itkCommonHeaderTest.cxx"



Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Loading
Loading