Skip to content

WIP: Replace UI with IT as index type for LevelSetNode VectorContainer - #6803

Draft
N-Dekker wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:Replace-UI-with-IT-index-type-LevelSetNode-VectorContainer
Draft

WIP: Replace UI with IT as index type for LevelSetNode VectorContainer#6803
N-Dekker wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:Replace-UI-with-IT-index-type-LevelSetNode-VectorContainer

Conversation

@N-Dekker

Copy link
Copy Markdown
Contributor

itk.IT ("IdentifierType") is the most commonly supported index type for VectorContainer. (VectorContainer is wrapped for IT and UC, but not for UI, as index type.)

@github-actions github-actions Bot added area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Filtering Issues affecting the Filtering module area:Segmentation Issues affecting the Segmentation module type:Style Style changes: no logic impact (indentation, comments, naming) labels Aug 25, 2026
@N-Dekker N-Dekker changed the title STYLE: Replace UI with IT as index type for LevelSetNode VectorContainer WIP: Replace UI with IT as index type for LevelSetNode VectorContainer Aug 25, 2026
@N-Dekker

Copy link
Copy Markdown
Contributor Author

Still under construction. I see now: in C++, NodeContainerType also has unsigned int as index type. Probably related.

using NodeContainerType = VectorContainer<unsigned int, NodeType>;

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a glance.

`itk.IT` ("IdentifierType") is the most commonly supported index type for
VectorContainer.

Adjusted `ShapePriorMAPCostFunctionBase::NodeContainerType` to use the default
index type of `itk::VectorContainer` (which is equal to `IdentifierType`).

Follow-up to pull request InsightSoftwareConsortium#6800
commit 0939d4c
"STYLE: Replace UL with IT as index type in itkPyVectorContainerTest.py"
@N-Dekker
N-Dekker force-pushed the Replace-UI-with-IT-index-type-LevelSetNode-VectorContainer branch from 5bb4e81 to 67912ce Compare August 26, 2026 13:47
@github-actions github-actions Bot removed the type:Style Style changes: no logic impact (indentation, comments, naming) label Aug 26, 2026
@N-Dekker

Copy link
Copy Markdown
Contributor Author

This force-pushed amend aims to address CI failures at https://open.cdash.org/tests/2723817696 saying:

  File "/Users/runner/work/1/s-build/Wrapping/Generators/Python/itk/support/template_class.py", line 527, in __getitem__
    this_item = self.__template__[key]
                ~~~~~~~~~~~~~~~~~^^^^^
KeyError: (<itkCType unsigned long>, <class 'itk.itkLevelSetNodePython.itkLevelSetNodeF2'>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/runner/work/1/s/Modules/Filtering/FastMarching/wrapping/test/FastMarchingImageFilterTest.py", line 131, in <module>
    NodeContainer = itk.VectorContainer[itk.IT, NodeType]
                    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/1/s-build/Wrapping/Generators/Python/itk/support/template_class.py", line 531, in __getitem__
    raise itk.TemplateTypeError(self, key)
itk.support.extras.TemplateTypeError: itk.VectorContainer is not wrapped for input type `itk.UL, itk.LevelSetNode[itk.F,2]`.


/** Type of container used to store the level set nodes. */
using NodeContainerType = VectorContainer<unsigned int, NodeType>;
using NodeContainerType = VectorContainer<NodeType>;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a potentially breaking change, although in practice, VectorContainer<unsigned int, NodeType> and VectorContainer<NodeType> behave exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module area:Python wrapping Python bindings for a class area:Segmentation Issues affecting the Segmentation module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants