Skip to content

Commit a1f3462

Browse files
committed
Merge remote-tracking branch 'upstream/main' into triage-6243-rebase
# Conflicts: # pyproject.toml
2 parents 53f020e + 0997958 commit a1f3462

58 files changed

Lines changed: 1048 additions & 66 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMake/ITKModuleTest.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# KitTests - a list of tests to be included in the test driver
1212
# ADDITIONAL_SRC (optional) - additional source files, which don't contain tests
1313

14+
include(ITKWindowsUtf8)
15+
1416
function(CreateTestDriver KIT KIT_LIBS KitTests)
1517
set(ADDITIONAL_SRC ${ARGN})
1618
if(EMSCRIPTEN)

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ include(PreventInSourceBuilds)
180180
include(PreventInBuildInstalls)
181181
include(ITKModuleMacros)
182182
include(ITKExternalData)
183-
include(ITKWindowsUtf8)
184183
include(ITKModuleTest)
185184
include(itkCheckSourceTree)
186185

Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <iostream>
2020

2121
#include "itkAffineTransform.h"
22+
#include "itkCastImageFilter.h"
23+
#include "itkPipelineMonitorImageFilter.h"
2224
#include "itkResampleImageFilter.h"
2325
#include "itkStreamingImageFilter.h"
2426
#include "itkTestingMacros.h"
@@ -79,8 +81,13 @@ itkResampleImageTest7(int, char *[])
7981
ITK_EXERCISE_BASIC_OBJECT_METHODS(resample, ResampleImageFilter, ImageToImageFilter);
8082
resample->SetInterpolator(interp);
8183

82-
resample->SetInput(image);
83-
ITK_TEST_SET_GET_VALUE(image.GetPointer(), resample->GetInput());
84+
const auto upstream = itk::CastImageFilter<ImageType, ImageType>::New();
85+
upstream->SetInput(image);
86+
using MonitorType = itk::PipelineMonitorImageFilter<ImageType>;
87+
const auto monitor = MonitorType::New();
88+
monitor->SetInput(upstream->GetOutput());
89+
resample->SetInput(monitor->GetOutput());
90+
ITK_TEST_SET_GET_VALUE(monitor->GetOutput(), resample->GetInput());
8491

8592
resample->SetSize(size);
8693
ITK_TEST_SET_GET_VALUE(size, resample->GetSize());
@@ -109,12 +116,20 @@ itkResampleImageTest7(int, char *[])
109116
const ImagePointerType outputNoSDI = streamer->GetOutput(); // save output for later comparison
110117
outputNoSDI->DisconnectPipeline(); // disconnect to create new output
111118

112-
// Run the resampling filter with streaming
119+
monitor->ClearPipelineSavedInformation();
120+
113121
image->Modified();
114-
numStreamDiv = 8; // split into numStream pieces for streaming.
122+
numStreamDiv = 8;
115123
streamer->SetNumberOfStreamDivisions(numStreamDiv);
116124
ITK_TRY_EXPECT_NO_EXCEPTION(streamer->UpdateLargestPossibleRegion());
117125

126+
if (!monitor->VerifyInputFilterExecutedStreaming(static_cast<int>(numStreamDiv)))
127+
{
128+
std::cerr << "Streaming did not chunk the input as expected." << std::endl;
129+
std::cerr << monitor;
130+
return EXIT_FAILURE;
131+
}
132+
118133
// Verify that we only requested a smaller chunk when streaming
119134
const ImageRegionType finalRequestedRegion(image->GetRequestedRegion());
120135
ITK_TEST_SET_GET_VALUE(0, finalRequestedRegion.GetIndex(0));

Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "itkMath.h"
2222
#include "itkWarpImageFilter.h"
2323
#include "itkCastImageFilter.h"
24+
#include "itkPipelineMonitorImageFilter.h"
2425
#include "itkStreamingImageFilter.h"
2526
#include "itkVectorImage.h"
2627
#include "itkTestingMacros.h"
@@ -318,23 +319,35 @@ itkWarpImageFilterTest(int, char *[])
318319

319320
std::cout << "Run ExpandImageFilter with streamer" << std::endl;
320321

322+
// Streaming verified on displacement-field input only; WarpImageFilter requests the full image input.
321323
using VectorCasterType = itk::CastImageFilter<FieldType, FieldType>;
322324
auto vcaster = VectorCasterType::New();
323-
324325
vcaster->SetInput(warper->GetDisplacementField());
325326

327+
using FieldMonitorType = itk::PipelineMonitorImageFilter<FieldType>;
328+
auto vmonitor = FieldMonitorType::New();
329+
vmonitor->SetInput(vcaster->GetOutput());
330+
326331
auto warper2 = WarperType::New();
327332

328333
warper2->SetInput(warper->GetInput());
329-
warper2->SetDisplacementField(vcaster->GetOutput());
334+
warper2->SetDisplacementField(vmonitor->GetOutput());
330335
warper2->SetEdgePaddingValue(warper->GetEdgePaddingValue());
331336

332337
using StreamerType = itk::StreamingImageFilter<ImageType, ImageType>;
333338
auto streamer = StreamerType::New();
334339
streamer->SetInput(warper2->GetOutput());
335-
streamer->SetNumberOfStreamDivisions(3);
340+
constexpr int numStreamDivisions = 3;
341+
streamer->SetNumberOfStreamDivisions(numStreamDivisions);
336342
streamer->Update();
337343

344+
if (!vmonitor->VerifyInputFilterExecutedStreaming(numStreamDivisions))
345+
{
346+
std::cerr << "Displacement field did not stream as expected." << std::endl;
347+
std::cerr << vmonitor;
348+
return EXIT_FAILURE;
349+
}
350+
338351
std::cout << "Compare standalone and streamed outputs" << std::endl;
339352

340353
Iterator streamIter(streamer->GetOutput(), streamer->GetOutput()->GetBufferedRegion());

Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "itkWarpVectorImageFilter.h"
2222
#include "itkCastImageFilter.h"
23+
#include "itkPipelineMonitorImageFilter.h"
2324
#include "itkStreamingImageFilter.h"
2425
#include "itkTestingMacros.h"
2526

@@ -297,18 +298,31 @@ itkWarpVectorImageFilterTest(int, char *[])
297298

298299
vcaster->SetInput(warper->GetDisplacementField());
299300

301+
// Streaming verified on displacement-field input only; WarpVectorImageFilter requests the full image input.
302+
using FieldMonitorType = itk::PipelineMonitorImageFilter<FieldType>;
303+
auto vmonitor = FieldMonitorType::New();
304+
vmonitor->SetInput(vcaster->GetOutput());
305+
300306
auto warper2 = WarperType::New();
301307

302308
warper2->SetInput(warper->GetInput());
303-
warper2->SetDisplacementField(vcaster->GetOutput());
309+
warper2->SetDisplacementField(vmonitor->GetOutput());
304310
warper2->SetEdgePaddingValue(warper->GetEdgePaddingValue());
305311

306312
using StreamerType = itk::StreamingImageFilter<ImageType, ImageType>;
307313
auto streamer = StreamerType::New();
308314
streamer->SetInput(warper2->GetOutput());
309-
streamer->SetNumberOfStreamDivisions(3);
315+
constexpr int numStreamDivisions = 3;
316+
streamer->SetNumberOfStreamDivisions(numStreamDivisions);
310317
streamer->Update();
311318

319+
if (!vmonitor->VerifyInputFilterExecutedStreaming(numStreamDivisions))
320+
{
321+
std::cerr << "Displacement field did not stream as expected." << std::endl;
322+
std::cerr << vmonitor;
323+
return EXIT_FAILURE;
324+
}
325+
312326
std::cout << "Compare standalone and streamed outputs" << std::endl;
313327

314328
Iterator streamIter(streamer->GetOutput(), streamer->GetOutput()->GetBufferedRegion());
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project(PrincipalComponentsAnalysis)
2+
3+
itk_module_impl()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PrincipalComponentsAnalysis
2+
3+
In-tree ITK module providing a principal component analysis filter for
4+
scalar, vector, and mesh-vertex data. The flagship class is
5+
`itk::VectorFieldPCA`, which computes the principal components of an
6+
ensemble of vector fields defined on a common mesh, useful for
7+
shape-modeling and multivariate statistics workflows.
8+
9+
## Origin
10+
11+
Ingested from the standalone remote module
12+
[**InsightSoftwareConsortium/ITKPrincipalComponentsAnalysis**](https://github.com/InsightSoftwareConsortium/ITKPrincipalComponentsAnalysis)
13+
on 2026-05-08, following the v4 ingestion guidelines defined in
14+
InsightSoftwareConsortium/ITK#6204. The upstream repository will be
15+
archived read-only after this PR merges; it remains reachable at the
16+
URL above for historical reference (notably the `doc/` and
17+
`examples/` directories, which were intentionally left in the
18+
upstream archive).
19+
20+
## References
21+
22+
- Bowers M., Younes L. *Principal Components Analysis of Scalar,
23+
Vector, and Mesh Vertex Data.* The Insight Journal. August, 2013.
24+
<https://doi.org/10.54294/loekqj>

0 commit comments

Comments
 (0)