-
-
Notifications
You must be signed in to change notification settings - Fork 65
Add debugging options for AutoTrack and add random starts to linear reg #112
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
base: master
Are you sure you want to change the base?
Conversation
add chen mode
update registratio for chen mode
|
thank you. I will review code to see how to integrate.
Matt Cieslak ***@***.***> 於 2026年1月21日 週三 17:17 寫道:
… Hi Frank,
I've been trying to match the Chen AutoTrack behavior in the current DSI
Studio codebase. It's probably not going to be possible to share the
testing data, so I tried to add back in some Chen methods. I did this in
two stages. First I edited the options to match Chen: PennLINC#1
<PennLINC#1> when --chen_mode=1. Then
I changed how spatial normalization is run: PennLINC#2
<PennLINC#2>.
I can confirm that these changes compile without any issue and that the
tractography looks better most of the time.
That being said, I'm not sure if all these changes actually make sense
technically and would be happy to refactor to better fit your vision for
DSI Studio. Could you please take a look and see if there's anything you
would advise against including? I've got a nice test setup to try out any
suggestions.
Thanks as ever!
------------------------------
You can view, comment on, or merge this pull request online at:
#112
Commit Summary
- 8e0ee6a
<8e0ee6a>
add chen mode
- abbbc57
<abbbc57>
don't change tract selection to chen compat
- 535ebe4
<535ebe4>
Merge pull request #1 from PennLINC/chen-mode
- abdf699
<abdf699>
attempt at a pro file
- f2eb815
<f2eb815>
Merge branch 'chen-mode'
- 81a5685
<81a5685>
remove gui components
- 4f8c26a
<4f8c26a>
Update pro
- ade5013
<ade5013>
update registratio for chen mode
- 598464a
<598464a>
Merge pull request #2 from PennLINC/chen-reg
- 13ef858
<13ef858>
seems like it works?
- 939362e
<939362e>
remove .pro
File Changes
(4 files <https://github.com/frankyeh/DSI-Studio/pull/112/files>)
- *M* auto_track.cpp
<https://github.com/frankyeh/DSI-Studio/pull/112/files#diff-f0f434f71c439d8ddebaffe67594a1aeb81d0e83532b62d719591b81d95fef2e>
(73)
- *M* libs/tracking/fib_data.cpp
<https://github.com/frankyeh/DSI-Studio/pull/112/files#diff-e39627eda87aeff32f4a44702d8a6133926921a881810fe872b439c9b46adf5f>
(209)
- *M* libs/tracking/fib_data.hpp
<https://github.com/frankyeh/DSI-Studio/pull/112/files#diff-21416e189fa802308c9478e0e9aeacdab32aa990cb78231045119e5c998c89ef>
(2)
- *M* reg.hpp
<https://github.com/frankyeh/DSI-Studio/pull/112/files#diff-59faf5693d19052380400fb939aa7145deeb57e7a367a9a2b3e933b0299174bd>
(59)
Patch Links:
- https://github.com/frankyeh/DSI-Studio/pull/112.patch
- https://github.com/frankyeh/DSI-Studio/pull/112.diff
—
Reply to this email directly, view it on GitHub
<#112>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDI4LQHMIFVYV7UODN4DD4H73IHAVCNFSM6AAAAACSOWVTG6VHI2DSMVQWIX3LMV43ASLTON2WKOZTHA2DAMRUGY4TGNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
I reviewed the code, and a large portion of it is the registration, but the Hou registration usually works better and handle large FOV which is very common in many DTI. Could you try using Hou reg + Chen mode and see if this gives similar results as previous Chen? |
|
On it! just to be sure - the Hou registration will work ok with the low anisotropy of the infant brains? Is the same amount of deformation possible in Hou and Chen? I got the impression that Chen was aiming for simpler deformations. Also, I don't think there is a benefit to keeping the map.gz format if it's deprecated in favor of .mz. I can remove map.gz support |
|
On it! just to be sure - the Hou registration will work ok with the low
anisotropy of the infant brains?
Both Chen and Hou will smooth the signal to handle low SNR.
Is the same amount of deformation possible in Hou and Chen? I got the
impression that Chen was aiming for simpler deformations.
Yes, Hou and Chen registration both have a "speed" parameter
controlling deformation. If the issue is due to this, I can open an option
to change this parameter.
Also, I don't think there is a benefit to keeping the map.gz format if
it's deprecated in favor of .mz. I can remove map.gz support
Yes, I would go for .mz because it includes version controls, and stores
both deformation directions.
It would be easier if we separate registration issues here and conquer them
separately.
The rest Chen-Hou differences can then be tackled one by one.
… —
Reply to this email directly, view it on GitHub
<#112 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDI4MH7BEJGKZ43LM4MBD4IDTV5AVCNFSM6AAAAACSOWVTG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOBUHE4TMNJWGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
You're right - the Hou registration is excellent, even in the tiny, low anisotropy brains. I've been checking this by saving the template bundles in native subject space and checking their overlap in the dsi studio gui. I removed the Chen code/options for registration from this PR and will follow up over email to debug the tractography parameters |
|
Follow-up on the auto-tracking part:
At this point, the remaining differences that matter are:
That leaves |
|
quick question - if I wanted to warp the template QA and ISO images so they could be visualized in the same space as the fib's QA and ISO is there an easy way to get that done? I've tried and and both produce an output in the dsi studio templates directory that is A-P flipped |
|
Here's the CLI for the Hou version:
https://dsi-studio.labsolver.org/doc/cli_reg.html
I can help checking to see if there is a bug here (could the data be
shared?) and I will fix it ASAP.
…On Fri, Jan 23, 2026 at 11:58 AM Matt Cieslak ***@***.***> wrote:
mattcieslak left a comment (frankyeh/DSI-Studio#112)
quick question - if I wanted to warp the template QA and ISO images so they could be visualized in the same space as the fib's QA and ISO is there an easy way to get that done? I've tried
dsi_studio --action=reg --source=${SUBJECT_QA} --to=${TEMPLATE_QA} --t2s=${TEMPLATE_ISO} --mapping=${MAPPING_FIELD}
and
dsi_studio --action=reg --to=${TEMPLATE_QA} --mapping=${MAPPING_FIELD}
and both produce an output in the dsi studio templates directory that is A-P flipped
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
| } | ||
| reg.linear_restarts = 6; | ||
| // Use a wider affine search (especially scaling) for lifespan differences. | ||
| static const float lifespan_affine_bound[3][8] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't what made the difference, I think it's the restarts
| const std::vector<unsigned int>& color) | ||
| { | ||
| tipl::progress prog0("saving " + file_name); | ||
| tipl::out() << "saving tt: file=" << file_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having trouble writing out tt files so I added a bunch of extra checks and fallbacks here. My suspicion is that the real issue was that the bad warps were causing template streamlines to be outside the field of view in native space, triggering a crash
|
I was able to get registration working consistently! The key change was to add random restarts to the linear registration. Trackingwise the TIP iterations had to be set lower, and the otsu threshold set a bit lower too. To figure this out, I added a couple other debugging features to autotrack. To access these, you can add items to a
If you just specify side note: There are some edits to tract_model.cpp where I was trying to figure out why autotrack was crashing when writing the template streamlines warped to subject space. It was only happening when there was a bad registration, but I think it might be helpful to keep some of the print-outs and exception handling. Happy to remove it too, though. |
Hi Frank,
I've been trying to match the Chen AutoTrack behavior in the current DSI Studio codebase. It's probably not going to be possible to share the testing data, so I tried to add back in some Chen methods. I did this in two stages. First I edited the options to match Chen: PennLINC#1 when
--chen_mode=1. Then I changed how spatial normalization is run: PennLINC#2.I can confirm that these changes compile without any issue and that the tractography looks better most of the time.
That being said, I'm not sure if all these changes actually make sense technically and would be happy to refactor to better fit your vision for DSI Studio. Could you please take a look and see if there's anything you would advise against including? I've got a nice test setup to try out any suggestions.
Thanks as ever!