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

Template dependence on image spacing #1540

Open
ntustison opened this issue May 21, 2023 · 5 comments
Open

Template dependence on image spacing #1540

ntustison opened this issue May 21, 2023 · 5 comments
Labels
question unsolved mysteries Issues that require further investigation to diagnose

Comments

@ntustison
Copy link
Member

Ran into a recent issue where a collaborator arbitrarily multiplied the image spacing by 1000 and generated a significantly different template---much better, in fact. Data were mice MRI with voxel spacing on the order of 0.05mm^3. Investigating this a bit, the SharpenImage step has a dependency on the image spacing (specifically, m_UseImageSpacing is true by default in the itkLaplacianSharpeningImageFilter). I'm posting this since a possible fix isn't obvious to me. Hoping for some thoughts.

@cookpa
Copy link
Member

cookpa commented May 21, 2023

I think this is an issue in multiple contexts and maybe in ITK generally as mentioned here for example

https://discourse.itk.org/t/register-two-binary-images-of-different-size-and-resolution/5936/2

Also

ANTsX/ANTsPy#362

That issue was fixed in ANTs by the gradient filters, which I need to port to ANTsPy to close out the issue.

@ntustison
Copy link
Member Author

Yes, it's definitely in other places but I think we can specifically address it in the template building. I'm here at the University of Minnesota with @stnava. We'll discuss this issue and I'll post what some of our thoughts are.

@cookpa
Copy link
Member

cookpa commented May 23, 2023

Some other places where spacing may come into play:

  • Default BSplineSyN params are [ 0.1,26,0,3 ], would need adjusting for small animals

  • N4 uses old convention of 200mm initial spline spacing

@ntustison
Copy link
Member Author

Thanks @cookpa.

Yeah, they don't concern me as much. Importantly, we're aware of both of these and we can provide guidance to the user. Specifically, for the former, I think you've mentioned your preference for N4 preprocessing prior to template building (which I would have chosen had I written the original buildtemplate.sh script, i.e., completely remove N4 from template building) and, for the latter, we can always suggest the user employ regular SyN to avoid the image spacing dependence (which is the default anyway).

When I believed the culprit was the Laplacian sharpening, my motivation for turning off image spacing dependence was the fact that most of our template building experience was based on the ~1mm data---basically equivalent to voxel space operation. Now I have to dig a bit further to figuring out what's causing the issue in addition to fixing the Laplacian filter on the ITK side. I'm going to keep this pull request on hold until I investigate further.

@spinicist
Copy link
Contributor

These assumptions on scale are baked into many tools, not just ANTs. When I used to do preclinical imaging we scaled up all voxel sizes by a factor of 10 on each dimension as standard practice, to be comparable to humans. Fixing all the tools wasn't practical!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question unsolved mysteries Issues that require further investigation to diagnose
Projects
None yet
Development

No branches or pull requests

3 participants