Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add TransformMINC to default modules #4160

Closed

Conversation

gdevenyi
Copy link
Contributor

Add TransformMINC to default modules.

MINC is already enabled by default but it's transforms were not.

Ref: conda-forge/libitk-feedstock#83

@github-actions github-actions bot added type:Enhancement Improvement of existing methods or implementation area:IO Issues affecting the IO module labels Aug 17, 2023
@dzenanz
Copy link
Member

dzenanz commented Aug 18, 2023

I assume you will be looking into test failures?

@gdevenyi
Copy link
Contributor Author

gdevenyi commented Aug 18, 2023

Surprised to see this as I already use this feature regularly and it works for me. Investigating.

Edit: Thankfully this is a feature component I don't use regularly

@gdevenyi
Copy link
Contributor Author

This is error:

  Expected coordinates ([1.41421, 1.41421, 0]) doesn't match read-in coordinates ([1.41421, -10, 0] )  in CompositeTransform (0x55e836de1160)

Failing at https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx#L602-L705

Paging @vfonov while I look at the code.

@gdevenyi
Copy link
Contributor Author

gdevenyi commented Aug 18, 2023

Ah ha, this looks like a typo in the test expected output value, v2[1] is uninitalized:
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx#L694

    v2[0] = v[1] = sqrt(2);

@github-actions github-actions bot added the type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct label Aug 18, 2023
@gdevenyi
Copy link
Contributor Author

gdevenyi commented Aug 18, 2023

@dzenanz I think we're all fixed now, two typos in the test

  1. Uninitialized expected result variable due to typo
  2. Error output of the test had variables swapped for read-in vs expected value

Requesting review from @vfonov

@gdevenyi gdevenyi requested a review from dzenanz August 18, 2023 17:18
@dzenanz dzenanz requested a review from vfonov August 18, 2023 17:40
@gdevenyi
Copy link
Contributor Author

Re-ping @vfonov

@dzenanz
Copy link
Member

dzenanz commented Aug 28, 2023

/azp run ITK.Windows

@jhlegarreta
Copy link
Member

Looks like the problem is in the allocation of the 4x4 matrix by VIO_ALLOC2D in
https://github.com/BIC-MNI/libminc/blob/master/volume_io/Geometry/inverse.c#L43

t seems not to have room for the expected 4x4 elements. The exception is raised immediately after i takes the value 1 in https://github.com/BIC-MNI/libminc/blob/master/volume_io/Geometry/inverse.c#L49

This should be enough so that the maintainers of the libmincrepository can look for the faulty allocation statement.

@vfonov
Copy link
Contributor

vfonov commented Aug 29, 2023

Looks like the problem is in the allocation of the 4x4 matrix by VIO_ALLOC2D in https://github.com/BIC-MNI/libminc/blob/master/volume_io/Geometry/inverse.c#L43

t seems not to have room for the expected 4x4 elements. The exception is raised immediately after i takes the value 1 in https://github.com/BIC-MNI/libminc/blob/master/volume_io/Geometry/inverse.c#L49

This should be enough so that the maintainers of the libmincrepository can look for the faulty allocation statement.

Maintainers looked and it's not clear why it would not allocate enough memory here and not in 1000 other places where it's used. Maybe it's corrupted memory from somewhere else?

@jhlegarreta
Copy link
Member

A few more thoughts at this:

Not sure how conclusive the above are, as @vfonov might have a point when saying that a previous memory problem may only appear at a latter stage, but they may provide some useful information.

@vfonov
Copy link
Contributor

vfonov commented Sep 6, 2023

Could it be possible to compile and run tests in windows with Address Sanitizer?

@jhlegarreta
Copy link
Member

Another thought:

Not sure if this has an impact on the bug, but should all factories be registered only once in the main method or should each method register its own factory? @thewtex @dzenanz @blowekamp @hjmjohnson what do you think?

@jhlegarreta
Copy link
Member

Rebase on master if PR #4184 makes it through just in case.

@gdevenyi
Copy link
Contributor Author

Rebased.

@gdevenyi gdevenyi force-pushed the default-minc branch 2 times, most recently from 00c0eb0 to c3cd3a5 Compare September 19, 2023 16:16
@github-actions github-actions bot removed the type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct label Sep 19, 2023
@gdevenyi
Copy link
Contributor Author

@jhlegarreta @dzenanz #4175 broke the tests completely.

@dzenanz
Copy link
Member

dzenanz commented Sep 20, 2023

Do the tests pass if #4175 is reverted?

@jhlegarreta
Copy link
Member

Do the tests pass if #4175 is reverted?

No. The module was not active and affected tests were not executed in PR #4175. ITK compiles correctly on all 3 platforms, without warnings (look for "default-minc"): https://open.cdash.org/index.php?project=Insight&date=2023-09-19. Tests do not pass, as it happened with the first commit pushed to this branch; test failures were then detected, and should be the same ones that have appeared with the latest push force.

@jhlegarreta @dzenanz #4175 broke the tests completely.

@gdevenyi No, look at the files that you modified in your last push force: the rebase was not done correctly, and the fixes to the test were not carried over correctly.

You can look for the changes in the git commits on the GitHub interface ("(...) force-pushed the default-minc branch (...) times, most recently from (...) to (...)"), e.g. 00c0eb0, or doing a git-reflog locally, recover them, and add them back to the commit.

PR #4175 only changed the style: as the lines modified overlap with the fixes to the test in the commits in this branch, rebasing needed manual work. Windows tests will still not pass after a proper rebase, unless the bug discussed with Vladimir is not stable.

@gdevenyi
Copy link
Contributor Author

gdevenyi commented Sep 20, 2023

This module was not be default enabled, doesn't seem to me that #4175 actually ran the tests the code changed.

I had commits to fix the original tests to get them passing, but that whole section of code was changed in #4175

@jhlegarreta
Copy link
Member

This module was not be default enabled, doesn't seem to me that #4175 actually ran the tests the code changed.

That was mentioned in #4175 (comment).

but that whole section of code was changed in #4175

See #4175 (comment) and #4175 (comment).

As said, changes can easily be recovered investigating commits, and should not be hard.

@gdevenyi
Copy link
Contributor Author

Before, the tests were failing with an error in the result.

After #4175, the tests don't run at all due to C++ code issues I don't understand.

2023-09-19T18:02:24.7708835Z           Start 1424: itkMINCTransformAdapterTest
2023-09-19T18:02:24.7709190Z 
2023-09-19T18:02:24.7710172Z 1424: Test command: /home/vsts/work/1/s-build/bin/ITKIOTransformMINCTestDriver "itkMINCTransformAdapterTest"
2023-09-19T18:02:24.7710963Z 1424: Working Directory: /home/vsts/work/1/s-build/Modules/IO/TransformMINC/test
2023-09-19T18:02:24.7711460Z 1424: Test timeout computed to be: 1500
2023-09-19T18:02:24.8109269Z 1424: MINCTransformAdapter (0x563cccee3fd0)
2023-09-19T18:02:24.8110610Z 1424:   RTTI typeinfo:   itk::MINCTransformAdapter<double, 3u, 3u>
2023-09-19T18:02:24.8111507Z 1424:   Reference Count: 1
2023-09-19T18:02:24.8111992Z 1424:   Modified Time: 107
2023-09-19T18:02:24.8112376Z 1424:   Debug: Off
2023-09-19T18:02:24.8112815Z 1424:   Object Name: 
2023-09-19T18:02:24.8113444Z 1424:   Observers: 
2023-09-19T18:02:24.8115025Z 1424:     none
2023-09-19T18:02:24.8115471Z 1424: Name of Class = MINCTransformAdapter
2023-09-19T18:02:24.8116332Z 1424: Trying xfm->TransformVector(vector, point)
2023-09-19T18:02:24.8134531Z 1424: Caught expected exception
2023-09-19T18:02:24.8137127Z 1424: 
2023-09-19T18:02:24.8137683Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8138214Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8139806Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8140257Z 1424: Line: 158
2023-09-19T18:02:24.8140774Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8142508Z 1424: 
2023-09-19T18:02:24.8142947Z 1424: 
2023-09-19T18:02:24.8143564Z 1424: Trying xfm->TransformVector(vnlVector, point)
2023-09-19T18:02:24.8144170Z 1424: Caught expected exception
2023-09-19T18:02:24.8144600Z 1424: 
2023-09-19T18:02:24.8144961Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8145316Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8145683Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8146050Z 1424: Line: 165
2023-09-19T18:02:24.8146421Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8147072Z 1424: 
2023-09-19T18:02:24.8147376Z 1424: 
2023-09-19T18:02:24.8147812Z 1424: Trying xfm->TransformVector(vectorPixel, point)
2023-09-19T18:02:24.8148257Z 1424: Caught expected exception
2023-09-19T18:02:24.8148595Z 1424: 
2023-09-19T18:02:24.8149079Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8149423Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8149821Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8150192Z 1424: Line: 193
2023-09-19T18:02:24.8150560Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8150900Z 1424: 
2023-09-19T18:02:24.8151182Z 1424: 
2023-09-19T18:02:24.8151670Z 1424: Trying xfm->TransformCovariantVector(covariantVector, point)
2023-09-19T18:02:24.8152065Z 1424: Caught expected exception
2023-09-19T18:02:24.8152384Z 1424: 
2023-09-19T18:02:24.8152720Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8153052Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8153446Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8153951Z 1424: Line: 200
2023-09-19T18:02:24.8154430Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8154854Z 1424: 
2023-09-19T18:02:24.8155207Z 1424: 
2023-09-19T18:02:24.8155676Z 1424: Trying xfm->TransformCovariantVector(vectorPixel, point)
2023-09-19T18:02:24.8156166Z 1424: Caught expected exception
2023-09-19T18:02:24.8170119Z 1424: 
2023-09-19T18:02:24.8170976Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8171483Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8171927Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8172394Z 1424: Line: 221
2023-09-19T18:02:24.8172866Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8173863Z 1424: 
2023-09-19T18:02:24.8174257Z 1424: 
2023-09-19T18:02:24.8174861Z 1424: Trying xfm->SetFixedParameters(fixedParams)
2023-09-19T18:02:24.8175268Z 1424: Caught expected exception
2023-09-19T18:02:24.8175645Z 1424: 
2023-09-19T18:02:24.8176055Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8176491Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8176989Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8177462Z 1424: Line: 235
2023-09-19T18:02:24.8177936Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8178411Z 1424: 
2023-09-19T18:02:24.8178812Z 1424: 
2023-09-19T18:02:24.8179371Z 1424: Trying xfm->ComputeJacobianWithRespectToParameters(point, jacobian)
2023-09-19T18:02:24.8179989Z 1424: Caught expected exception
2023-09-19T18:02:24.8180391Z 1424: 
2023-09-19T18:02:24.8180840Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8181225Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8181624Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8181996Z 1424: Line: 241
2023-09-19T18:02:24.8189588Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8190254Z 1424: 
2023-09-19T18:02:24.8190650Z 1424: 
2023-09-19T18:02:24.8191164Z 1424: Trying xfm->GetNumberOfParameters()
2023-09-19T18:02:24.8191593Z 1424: Caught expected exception
2023-09-19T18:02:24.8191942Z 1424: 
2023-09-19T18:02:24.8192469Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8192815Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8203128Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8203888Z 1424: Line: 248
2023-09-19T18:02:24.8204559Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Defined
2023-09-19T18:02:24.8205132Z 1424: 
2023-09-19T18:02:24.8205514Z 1424: 
2023-09-19T18:02:24.8206313Z 1424: Trying xfm->SetParameters(params)
2023-09-19T18:02:24.8206803Z 1424: Caught expected exception
2023-09-19T18:02:24.8207701Z 1424: 
2023-09-19T18:02:24.8213580Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8214043Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8214769Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8215132Z 1424: Line: 256
2023-09-19T18:02:24.8215563Z 1423: AffineTransform (0x564724241990)
2023-09-19T18:02:24.8215970Z 1423:   RTTI typeinfo:   itk::AffineTransform<double, 3u>
2023-09-19T18:02:24.8216340Z 1423:   Reference Count: 2
2023-09-19T18:02:24.8216665Z 1423:   Modified Time: 619
2023-09-19T18:02:24.8217001Z 1423:   Debug: Off
2023-09-19T18:02:24.8217304Z 1423:   Object Name: 
2023-09-19T18:02:24.8217647Z 1423:   Observers: 
2023-09-19T18:02:24.8217959Z 1423:     none
2023-09-19T18:02:24.8218253Z 1423:   Matrix: 
2023-09-19T18:02:24.8218603Z 1423:     3.4641 0 2 
2023-09-19T18:02:24.8218901Z 1423:     0 4 0 
2023-09-19T18:02:24.8219345Z 1423:     -2 0 3.4641 
2023-09-19T18:02:24.8219690Z 1423:   Offset: [0, 0, 40]
2023-09-19T18:02:24.8220041Z 1423:   Center: [0, 0, 0]
2023-09-19T18:02:24.8220463Z 1423:   Translation: [0, 0, 40]
2023-09-19T18:02:24.8220843Z 1423:   Inverse: 
2023-09-19T18:02:24.8221316Z 1423:     0.216506 0 -0.125 
2023-09-19T18:02:24.8221797Z 1423:     0 0.25 0 
2023-09-19T18:02:24.8222171Z 1423:     0.125 0 0.216506 
2023-09-19T18:02:24.8222644Z 1423:   Singular: 0
2023-09-19T18:02:24.8223135Z 1423: Trying writer->Update()
2023-09-19T18:02:24.8224307Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8224701Z 1424: 
2023-09-19T18:02:24.8225091Z 1424: 
2023-09-19T18:02:24.8225581Z 1424: Trying xfm->GetParameters()
2023-09-19T18:02:24.8226175Z 1424: Caught expected exception
2023-09-19T18:02:24.8226555Z 1424: 
2023-09-19T18:02:24.8227046Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8227460Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8228041Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8228587Z 1424: Line: 262
2023-09-19T18:02:24.8229011Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented
2023-09-19T18:02:24.8229921Z 1423: Testing read : 
2023-09-19T18:02:24.8230445Z 1423: Trying reader->Update()
2023-09-19T18:02:24.8232948Z 1423: Read transform : 
2023-09-19T18:02:24.8233581Z 1423: AffineTransform (0x5647242518e0)
2023-09-19T18:02:24.8233939Z 1423:   RTTI typeinfo:   itk::AffineTransform<double, 3u>
2023-09-19T18:02:24.8234328Z 1423:   Reference Count: 4
2023-09-19T18:02:24.8234653Z 1423:   Modified Time: 633
2023-09-19T18:02:24.8234975Z 1423:   Debug: Off
2023-09-19T18:02:24.8235395Z 1423:   Object Name: 
2023-09-19T18:02:24.8235734Z 1423:   Observers: 
2023-09-19T18:02:24.8236028Z 1423:     none
2023-09-19T18:02:24.8236316Z 1423:   Matrix: 
2023-09-19T18:02:24.8236644Z 1423:     3.4641 0 2 
2023-09-19T18:02:24.8236955Z 1423:     0 4 0 
2023-09-19T18:02:24.8237325Z 1423:     -2 0 3.4641 
2023-09-19T18:02:24.8237690Z 1423:   Offset: [0, 0, 40]
2023-09-19T18:02:24.8238022Z 1423:   Center: [0, 0, 0]
2023-09-19T18:02:24.8238473Z 1423:   Translation: [0, 0, 40]
2023-09-19T18:02:24.8238874Z 1423:   Inverse: 
2023-09-19T18:02:24.8239330Z 1423:     0.216506 0 -0.125 
2023-09-19T18:02:24.8239767Z 1423:     0 0.25 0 
2023-09-19T18:02:24.8240165Z 1423:     0.125 0 0.216506 
2023-09-19T18:02:24.8240823Z 1423:   Singular: 0
2023-09-19T18:02:24.8241290Z 1423: Testing that transformations are the same ...
2023-09-19T18:02:24.8243340Z 1423:  Done !
2023-09-19T18:02:24.8246440Z 1423: DisplacementFieldTransform (0x5647242286c0)
2023-09-19T18:02:24.8246861Z 1423:   RTTI typeinfo:   itk::DisplacementFieldTransform<double, 3u>
2023-09-19T18:02:24.8247229Z 1423:   Reference Count: 1
2023-09-19T18:02:24.8247591Z 1423:   Modified Time: 645
2023-09-19T18:02:24.8247918Z 1423:   Debug: Off
2023-09-19T18:02:24.8248419Z 1423:   Object Name: 
2023-09-19T18:02:24.8248741Z 1423:   Observers: 
2023-09-19T18:02:24.8249038Z 1423:     none
2023-09-19T18:02:24.8249361Z 1423:   DisplacementField: 
2023-09-19T18:02:24.8249698Z 1423:     Image (0x564724243380)
2023-09-19T18:02:24.8250053Z 1423:       RTTI typeinfo:   itk::Image<itk::Vector<double, 3u>, 3u>
2023-09-19T18:02:24.8250540Z 1423:       Reference Count: 4
2023-09-19T18:02:24.8250854Z 1423:       Modified Time: 643
2023-09-19T18:02:24.8251176Z 1423:       Debug: Off
2023-09-19T18:02:24.8251480Z 1423:       Object Name: 
2023-09-19T18:02:24.8251815Z 1423:       Observers: 
2023-09-19T18:02:24.8252132Z 1423:         none
2023-09-19T18:02:24.8252430Z 1423:       Source: (none)
2023-09-19T18:02:24.8252757Z 1423:       Source output name: (none)
2023-09-19T18:02:24.8253115Z 1423:       Release Data: Off
2023-09-19T18:02:24.8253427Z 1423:       Data Released: False
2023-09-19T18:02:24.8253742Z 1423:       Global Release Data: Off
2023-09-19T18:02:24.8254073Z 1423:       PipelineMTime: 0
2023-09-19T18:02:24.8254380Z 1423:       UpdateMTime: 0
2023-09-19T18:02:24.8254708Z 1423:       RealTimeStamp: 0 seconds 
2023-09-19T18:02:24.8255041Z 1423:       LargestPossibleRegion: 
2023-09-19T18:02:24.8255350Z 1423:         Dimension: 3
2023-09-19T18:02:24.8255668Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8255991Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8256316Z 1423:       BufferedRegion: 
2023-09-19T18:02:24.8256632Z 1423:         Dimension: 3
2023-09-19T18:02:24.8256928Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8257247Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8257588Z 1423:       RequestedRegion: 
2023-09-19T18:02:24.8257889Z 1423:         Dimension: 3
2023-09-19T18:02:24.8258210Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8258532Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8258928Z 1423:       Spacing: [2, 2, 2]
2023-09-19T18:02:24.8259399Z 1423:       Origin: [-10, -10, -10]
2023-09-19T18:02:24.8259773Z 1423:       Direction: 
2023-09-19T18:02:24.8260110Z 1423: 1 0 0
2023-09-19T18:02:24.8260441Z 1423: 0 1 0
2023-09-19T18:02:24.8260766Z 1423: 0 0 1
2023-09-19T18:02:24.8261103Z 1423: 
2023-09-19T18:02:24.8261403Z 1423:       IndexToPointMatrix: 
2023-09-19T18:02:24.8261721Z 1423: 2 0 0
2023-09-19T18:02:24.8262113Z 1423: 0 2 0
2023-09-19T18:02:24.8262498Z 1423: 0 0 2
2023-09-19T18:02:24.8262871Z 1423: 
2023-09-19T18:02:24.8263221Z 1423:       PointToIndexMatrix: 
2023-09-19T18:02:24.8263596Z 1423: 0.5 0 0
2023-09-19T18:02:24.8263960Z 1423: 0 0.5 0
2023-09-19T18:02:24.8264302Z 1423: 0 0 0.5
2023-09-19T18:02:24.8264623Z 1423: 
2023-09-19T18:02:24.8264973Z 1423:       Inverse Direction: 
2023-09-19T18:02:24.8265324Z 1423: 1 0 0
2023-09-19T18:02:24.8265646Z 1423: 0 1 0
2023-09-19T18:02:24.8266002Z 1423: 0 0 1
2023-09-19T18:02:24.8266356Z 1423: 
2023-09-19T18:02:24.8266722Z 1423:       PixelContainer: 
2023-09-19T18:02:24.8267066Z 1423:         ImportImageContainer (0x56472423bd40)
2023-09-19T18:02:24.8267472Z 1423:           RTTI typeinfo:   itk::ImportImageContainer<unsigned long, itk::Vector<double, 3u> >
2023-09-19T18:02:24.8267886Z 1423:           Reference Count: 1
2023-09-19T18:02:24.8268228Z 1423:           Modified Time: 644
2023-09-19T18:02:24.8268545Z 1423:           Debug: Off
2023-09-19T18:02:24.8268854Z 1423:           Object Name: 
2023-09-19T18:02:24.8269200Z 1423:           Observers: 
2023-09-19T18:02:24.8269525Z 1423:             none
2023-09-19T18:02:24.8269903Z 1423:           Pointer: 0x564724251bc0
2023-09-19T18:02:24.8270299Z 1423:           Container manages memory: true
2023-09-19T18:02:24.8270651Z 1423:           Size: 1000
2023-09-19T18:02:24.8271025Z 1423:           Capacity: 1000
2023-09-19T18:02:24.8271396Z 1423:   InverseDisplacementField: (null)
2023-09-19T18:02:24.8271749Z 1423:   Interpolator: 
2023-09-19T18:02:24.8272122Z 1423:     VectorLinearInterpolateImageFunction (0x564724225700)
2023-09-19T18:02:24.8272580Z 1423:       RTTI typeinfo:   itk::VectorLinearInterpolateImageFunction<itk::Image<itk::Vector<double, 3u>, 3u>, double>
2023-09-19T18:02:24.8273142Z 1423:       Reference Count: 1
2023-09-19T18:02:24.8273487Z 1423:       Modified Time: 635
2023-09-19T18:02:24.8273819Z 1423:       Debug: Off
2023-09-19T18:02:24.8274135Z 1423:       Object Name: 
2023-09-19T18:02:24.8274437Z 1423:       Observers: 
2023-09-19T18:02:24.8274816Z 1423:         none
2023-09-19T18:02:24.8275124Z 1423:       InputImage: 0x564724243380
2023-09-19T18:02:24.8275441Z 1423:       StartIndex: [0, 0, 0]
2023-09-19T18:02:24.8275764Z 1423:       EndIndex: [9, 9, 9]
2023-09-19T18:02:24.8276239Z 1423:       StartContinuousIndex: [-0.5, -0.5, -0.5]
2023-09-19T18:02:24.8276611Z 1423:       EndContinuousIndex: [9.5, 9.5, 9.5]
2023-09-19T18:02:24.8277049Z 1423:   InverseInterpolator: 
2023-09-19T18:02:24.8277466Z 1423:     VectorLinearInterpolateImageFunction (0x564724240280)
2023-09-19T18:02:24.8277969Z 1423:       RTTI typeinfo:   itk::VectorLinearInterpolateImageFunction<itk::Image<itk::Vector<double, 3u>, 3u>, double>
2023-09-19T18:02:24.8278418Z 1423:       Reference Count: 1
2023-09-19T18:02:24.8278726Z 1423:       Modified Time: 636
2023-09-19T18:02:24.8279044Z 1423:       Debug: Off
2023-09-19T18:02:24.8279368Z 1423:       Object Name: 
2023-09-19T18:02:24.8279668Z 1423:       Observers: 
2023-09-19T18:02:24.8279983Z 1423:         none
2023-09-19T18:02:24.8280309Z 1423:       InputImage: 0
2023-09-19T18:02:24.8280617Z 1423:       StartIndex: [0, 0, 0]
2023-09-19T18:02:24.8281033Z 1423:       EndIndex: [0, 0, 0]
2023-09-19T18:02:24.8281394Z 1423:       StartContinuousIndex: [0, 0, 0]
2023-09-19T18:02:24.8281831Z 1423:       EndContinuousIndex: [0, 0, 0]
2023-09-19T18:02:24.8282220Z 1423:   DisplacementFieldSetTime: 645
2023-09-19T18:02:24.8282583Z 1423:   IdentityJacobian: [1, 0, 0]
2023-09-19T18:02:24.8282965Z 1423: [0, 1, 0]
2023-09-19T18:02:24.8283255Z 1423: [0, 0, 1]
2023-09-19T18:02:24.8283586Z 1423: 
2023-09-19T18:02:24.8284087Z 1423:   CoordinateTolerance: 1e-06
2023-09-19T18:02:24.8284620Z 1423:   DirectionTolerance: 1e-06
2023-09-19T18:02:24.8285006Z 1423: Testing write of non linear transform (double) : 
2023-09-19T18:02:24.8285542Z 1423: Trying nlwriter->Update()
2023-09-19T18:02:24.8285889Z 1424: 
2023-09-19T18:02:24.8286201Z 1424: 
2023-09-19T18:02:24.8286548Z 1424: Trying TransformAdapterTypeExcp11::New()
2023-09-19T18:02:24.8286956Z 1424: WARNING: In /home/vsts/work/1/s/Modules/Core/Common/src/itkLightObject.cxx, line 182
2023-09-19T18:02:24.8287518Z 1424: LightObject (0x563cccee55f0): Trying to delete object with non-zero reference count.
2023-09-19T18:02:24.8287885Z 1424: 
2023-09-19T18:02:24.8288378Z 1424: Caught expected exception
2023-09-19T18:02:24.8288714Z 1424: 
2023-09-19T18:02:24.8289052Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8289402Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8289787Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8290135Z 1424: Line: 296
2023-09-19T18:02:24.8290534Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee55f0): MINC transform is currently implemented only for 3D to 3D.
2023-09-19T18:02:24.8290958Z 1424: 
2023-09-19T18:02:24.8291250Z 1424: 
2023-09-19T18:02:24.8291574Z 1424: Trying TransformAdapterTypeExcp22::New()
2023-09-19T18:02:24.8292021Z 1424: WARNING: In /home/vsts/work/1/s/Modules/Core/Common/src/itkLightObject.cxx, line 182
2023-09-19T18:02:24.8292579Z 1424: LightObject (0x563cccee55f0): Trying to delete object with non-zero reference count.
2023-09-19T18:02:24.8292964Z 1424: 
2023-09-19T18:02:24.8293297Z 1424: Caught expected exception
2023-09-19T18:02:24.8293613Z 1424: 
2023-09-19T18:02:24.8293941Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8294285Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8294844Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8295217Z 1424: Line: 296
2023-09-19T18:02:24.8295637Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee55f0): MINC transform is currently implemented only for 3D to 3D.
2023-09-19T18:02:24.8296188Z 1424: 
2023-09-19T18:02:24.8296482Z 1424: 
2023-09-19T18:02:24.8296806Z 1424: Trying TransformAdapterTypeExcp44::New()
2023-09-19T18:02:24.8297234Z 1424: WARNING: In /home/vsts/work/1/s/Modules/Core/Common/src/itkLightObject.cxx, line 182
2023-09-19T18:02:24.8297879Z 1424: LightObject (0x563cccee55f0): Trying to delete object with non-zero reference count.
2023-09-19T18:02:24.8298302Z 1424: 
2023-09-19T18:02:24.8298694Z 1424: Caught expected exception
2023-09-19T18:02:24.8298995Z 1424: 
2023-09-19T18:02:24.8299329Z 1424: itk::ExceptionObject (0x563cccee54f0)
2023-09-19T18:02:24.8299657Z 1424: Location: "unknown" 
2023-09-19T18:02:24.8300123Z 1424: File: /home/vsts/work/1/s/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h
2023-09-19T18:02:24.8300531Z 1424: Line: 296
2023-09-19T18:02:24.8300912Z 1424: Description: ITK ERROR: MINCTransformAdapter(0x563cccee55f0): MINC transform is currently implemented only for 3D to 3D.
2023-09-19T18:02:24.8301307Z 1424: 
2023-09-19T18:02:24.8301693Z 1424: 
2023-09-19T18:02:24.8335416Z 1424: Comparing of linear transforms ITK vs MINC: AffineTransform (0x563cccee6c70)
2023-09-19T18:02:24.8336258Z 1424:   RTTI typeinfo:   itk::AffineTransform<double, 3u>
2023-09-19T18:02:24.8336766Z 1424:   Reference Count: 4
2023-09-19T18:02:24.8337231Z 1424:   Modified Time: 618
2023-09-19T18:02:24.8337640Z 1424:   Debug: Off
2023-09-19T18:02:24.8338065Z 1424:   Object Name: 
2023-09-19T18:02:24.8339159Z 1424:   Observers: 
2023-09-19T18:02:24.8339652Z 1424:     none
2023-09-19T18:02:24.8340020Z 1424:   Matrix: 
2023-09-19T18:02:24.8340411Z 1424:     1.17956 0.0204445 0.219615 
2023-09-19T18:02:24.8341174Z 1424:     0.0204445 1.17956 -0.219615 
2023-09-19T18:02:24.8341705Z 1424:     -0.219615 0.219615 1.15911 
2023-09-19T18:02:24.8342159Z 1424:   Offset: [0, 0, 12]
2023-09-19T18:02:24.8342687Z 1424:   Center: [0, 0, 0]
2023-09-19T18:02:24.8343207Z 1424:   Translation: [0, 0, 12]
2023-09-19T18:02:24.8343735Z 1424:   Inverse: 
2023-09-19T18:02:24.8344303Z 1424:     0.819136 0.0141976 -0.152511 
2023-09-19T18:02:24.8344742Z 1424:     0.0141976 0.819136 0.152511 
2023-09-19T18:02:24.8345185Z 1424:     0.152511 -0.152511 0.804938 
2023-09-19T18:02:24.8345523Z 1424:   Singular: 0
2023-09-19T18:02:24.8345851Z 1424: 
2023-09-19T18:02:24.8436853Z 1424: Comparing of non linear transforms ITK vs MINC 
2023-09-19T18:02:24.8437796Z 1423: Testing read of non linear transform (double): 
2023-09-19T18:02:24.8438505Z 1423: Trying nlreader->Update()
2023-09-19T18:02:24.8470697Z 1423: [PASSED]
2023-09-19T18:02:24.8471455Z 1423: Comparing of non linear transform (double) : 
2023-09-19T18:02:24.8472074Z 1423: Read :1 transformations
2023-09-19T18:02:24.8483272Z 1423: DisplacementFieldTransform (0x5647242286c0)
2023-09-19T18:02:24.8483991Z 1423:   RTTI typeinfo:   itk::DisplacementFieldTransform<float, 3u>
2023-09-19T18:02:24.8484723Z 1423:   Reference Count: 1
2023-09-19T18:02:24.8485887Z 1423:   Modified Time: 770
2023-09-19T18:02:24.8486378Z 1423:   Debug: Off
2023-09-19T18:02:24.8486796Z 1423:   Object Name: 
2023-09-19T18:02:24.8487167Z 1423:   Observers: 
2023-09-19T18:02:24.8487525Z 1423:     none
2023-09-19T18:02:24.8487849Z 1423:   DisplacementField: 
2023-09-19T18:02:24.8488166Z 1423:     Image (0x564724243380)
2023-09-19T18:02:24.8488565Z 1423:       RTTI typeinfo:   itk::Image<itk::Vector<float, 3u>, 3u>
2023-09-19T18:02:24.8488918Z 1423:       Reference Count: 4
2023-09-19T18:02:24.8489243Z 1423:       Modified Time: 768
2023-09-19T18:02:24.8489563Z 1423:       Debug: Off
2023-09-19T18:02:24.8489867Z 1423:       Object Name: 
2023-09-19T18:02:24.8490165Z 1423:       Observers: 
2023-09-19T18:02:24.8490492Z 1423:         none
2023-09-19T18:02:24.8490787Z 1423:       Source: (none)
2023-09-19T18:02:24.8491119Z 1423:       Source output name: (none)
2023-09-19T18:02:24.8491452Z 1423:       Release Data: Off
2023-09-19T18:02:24.8491764Z 1423:       Data Released: False
2023-09-19T18:02:24.8492098Z 1423:       Global Release Data: Off
2023-09-19T18:02:24.8492671Z 1423:       PipelineMTime: 0
2023-09-19T18:02:24.8492989Z 1423:       UpdateMTime: 0
2023-09-19T18:02:24.8493295Z 1423:       RealTimeStamp: 0 seconds 
2023-09-19T18:02:24.8493635Z 1423:       LargestPossibleRegion: 
2023-09-19T18:02:24.8493993Z 1423:         Dimension: 3
2023-09-19T18:02:24.8494292Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8494718Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8495024Z 1423:       BufferedRegion: 
2023-09-19T18:02:24.8495364Z 1423:         Dimension: 3
2023-09-19T18:02:24.8495664Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8495985Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8496290Z 1423:       RequestedRegion: 
2023-09-19T18:02:24.8496593Z 1423:         Dimension: 3
2023-09-19T18:02:24.8496925Z 1423:         Index: [0, 0, 0]
2023-09-19T18:02:24.8497250Z 1423:         Size: [10, 10, 10]
2023-09-19T18:02:24.8497554Z 1423:       Spacing: [2, 2, 2]
2023-09-19T18:02:24.8498097Z 1423:       Origin: [-10, -10, -10]
2023-09-19T18:02:24.8498418Z 1423:       Direction: 
2023-09-19T18:02:24.8498710Z 1423: 1 0 0
2023-09-19T18:02:24.8499015Z 1423: 0 1 0
2023-09-19T18:02:24.8499323Z 1423: 0 0 1
2023-09-19T18:02:24.8499610Z 1423: 
2023-09-19T18:02:24.8499928Z 1423:       IndexToPointMatrix: 
2023-09-19T18:02:24.8500226Z 1423: 2 0 0
2023-09-19T18:02:24.8500523Z 1423: 0 2 0
2023-09-19T18:02:24.8500825Z 1423: 0 0 2
2023-09-19T18:02:24.8501126Z 1423: 
2023-09-19T18:02:24.8501427Z 1423:       PointToIndexMatrix: 
2023-09-19T18:02:24.8501746Z 1423: 0.5 0 0
2023-09-19T18:02:24.8502051Z 1423: 0 0.5 0
2023-09-19T18:02:24.8502355Z 1423: 0 0 0.5
2023-09-19T18:02:24.8502635Z 1423: 
2023-09-19T18:02:24.8502965Z 1423:       Inverse Direction: 
2023-09-19T18:02:24.8503262Z 1423: 1 0 0
2023-09-19T18:02:24.8503545Z 1423: 0 1 0
2023-09-19T18:02:24.8503828Z 1423: 0 0 1
2023-09-19T18:02:24.8504107Z 1423: 
2023-09-19T18:02:24.8504431Z 1423:       PixelContainer: 
2023-09-19T18:02:24.8504754Z 1423:         ImportImageContainer (0x56472423bd40)
2023-09-19T18:02:24.8505241Z 1423:           RTTI typeinfo:   itk::ImportImageContainer<unsigned long, itk::Vector<float, 3u> >
2023-09-19T18:02:24.8505644Z 1423:           Reference Count: 1
2023-09-19T18:02:24.8506089Z 1423:           Modified Time: 769
2023-09-19T18:02:24.8506436Z 1423:           Debug: Off
2023-09-19T18:02:24.8506779Z 1423:           Object Name: 
2023-09-19T18:02:24.8507105Z 1423:           Observers: 
2023-09-19T18:02:24.8507401Z 1423:             none
2023-09-19T18:02:24.8507726Z 1423:           Pointer: 0x564724251bc0
2023-09-19T18:02:24.8508128Z 1423:           Container manages memory: true
2023-09-19T18:02:24.8508515Z 1423:           Size: 1000
2023-09-19T18:02:24.8508856Z 1423:           Capacity: 1000
2023-09-19T18:02:24.8509283Z 1423:   InverseDisplacementField: (null)
2023-09-19T18:02:24.8509657Z 1423:   Interpolator: 
2023-09-19T18:02:24.8510002Z 1423:     VectorLinearInterpolateImageFunction (0x5647242d2580)
2023-09-19T18:02:24.8510424Z 1423:       RTTI typeinfo:   itk::VectorLinearInterpolateImageFunction<itk::Image<itk::Vector<float, 3u>, 3u>, float>
2023-09-19T18:02:24.8510834Z 1423:       Reference Count: 1
2023-09-19T18:02:24.8511153Z 1423:       Modified Time: 760
2023-09-19T18:02:24.8511451Z 1423:       Debug: Off
2023-09-19T18:02:24.8511750Z 1423:       Object Name: 
2023-09-19T18:02:24.8512106Z 1423:       Observers: 
2023-09-19T18:02:24.8512417Z 1423:         none
2023-09-19T18:02:24.8512775Z 1423:       InputImage: 0x564724243380
2023-09-19T18:02:24.8513109Z 1423:       StartIndex: [0, 0, 0]
2023-09-19T18:02:24.8513435Z 1423:       EndIndex: [9, 9, 9]
2023-09-19T18:02:24.8513901Z 1423:       StartContinuousIndex: [-0.5, -0.5, -0.5]
2023-09-19T18:02:24.8514265Z 1423:       EndContinuousIndex: [9.5, 9.5, 9.5]
2023-09-19T18:02:24.8514623Z 1423:   InverseInterpolator: 
2023-09-19T18:02:24.8514979Z 1423:     VectorLinearInterpolateImageFunction (0x5647242d1560)
2023-09-19T18:02:24.8515411Z 1423:       RTTI typeinfo:   itk::VectorLinearInterpolateImageFunction<itk::Image<itk::Vector<float, 3u>, 3u>, float>
2023-09-19T18:02:24.8515994Z 1423:       Reference Count: 1
2023-09-19T18:02:24.8516324Z 1423:       Modified Time: 761
2023-09-19T18:02:24.8516625Z 1423:       Debug: Off
2023-09-19T18:02:24.8516923Z 1423:       Object Name: 
2023-09-19T18:02:24.8517241Z 1423:       Observers: 
2023-09-19T18:02:24.8517535Z 1423:         none
2023-09-19T18:02:24.8517929Z 1423:       InputImage: 0
2023-09-19T18:02:24.8518272Z 1423:       StartIndex: [0, 0, 0]
2023-09-19T18:02:24.8518602Z 1423:       EndIndex: [0, 0, 0]
2023-09-19T18:02:24.8518922Z 1423:       StartContinuousIndex: [0, 0, 0]
2023-09-19T18:02:24.8519282Z 1423:       EndContinuousIndex: [0, 0, 0]
2023-09-19T18:02:24.8519629Z 1423:   DisplacementFieldSetTime: 770
2023-09-19T18:02:24.8520009Z 1423:   IdentityJacobian: [1, 0, 0]
2023-09-19T18:02:24.8520355Z 1423: [0, 1, 0]
2023-09-19T18:02:24.8520707Z 1423: [0, 0, 1]
2023-09-19T18:02:24.8521049Z 1423: 
2023-09-19T18:02:24.8521393Z 1423:   CoordinateTolerance: 1e-06
2023-09-19T18:02:24.8521717Z 1423:   DirectionTolerance: 1e-06
2023-09-19T18:02:24.8522102Z 1423: Testing write of non linear transform (float): 
2023-09-19T18:02:24.8522539Z 1423: Trying nlwriter->Update()

@jhlegarreta
Copy link
Member

jhlegarreta commented Sep 20, 2023

After #4175, the tests don't run at all due to C++ code issues I don't understand.

Gabriel, the test is running:
https://open.cdash.org/viewTest.php?onlyfailed&buildid=9002558

The trace that you post are mainly exceptions that are captured correctly ("Caught expected exception") and other print statements; you just need to include back #4160 (comment) and 00c0eb0. That will make Linux and macOS pass, and we will be left back with the Windows segfault issue.

@gdevenyi
Copy link
Contributor Author

So,

#4175 extensively changed the code such that a simple rebase failed, and massively raised the noise level on the test such that I couldn't see what was happening.
and
Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented reads as error to me as well but seems ERROR doesn't mean what I thought it means.

Fine.

@github-actions github-actions bot added the type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct label Sep 20, 2023
@jhlegarreta
Copy link
Member

Has been said multiple times: code is read many more times that it is written, and readability and consistency are important.

Printing images or other ITK objects is something that I never (or very, very rarely) do in tests, but there are many tests that have such statements; I usually do not remove them, e.g.
https://github.com/jhlegarreta/ITK/blob/ca607a140ae81819aa750e6847b145290863ba1b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx#L116

And that raises any noise level, and frequently makes the error trace to be clipped on the dashboard.

Description: ITK ERROR: MINCTransformAdapter(0x563cccee3fd0): Not Implemented reads as error to me as well but seems ERROR doesn't mean what I thought it means.

That is just the exception macro.

@@ -19,5 +19,4 @@ itk_module(ITKIOTransformMINC
TransformIO::MINC
DESCRIPTION
"${DOCUMENTATION}"
EXCLUDE_FROM_DEFAULT
Copy link
Member

Choose a reason for hiding this comment

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

We cannot enable this by default until Windows segfault is fixed.

@@ -628,7 +628,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file)
pnt[0] = 1.0;
pnt[1] = pnt[2] = 0.0;
// expected transform: shift by 1 , rotate by 45 deg
v2[0] = v[1] = sqrt(2);
v2[0] = v2[1] = sqrt(2);
Copy link
Member

Choose a reason for hiding this comment

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

Unless someone is going to look into Windows issue soon, we could turn this fix into a new PR that can be merged quickly.

@thewtex thewtex added this to the ITK 5.4.0 milestone Sep 26, 2023
@gdevenyi
Copy link
Contributor Author

I can't fix windows things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:IO Issues affecting the IO module type:Enhancement Improvement of existing methods or implementation 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.

5 participants