CoBrALab / optimized_antsMultivariateTemplateConstruction

A re-implementation of antsMultivariateTemplateConstruction2.sh using optimized image pyramid scale-space and qbatch support
Other
20 stars 8 forks source link

Padding for initial average #62

Closed araikes closed 1 year ago

araikes commented 1 year ago

Hi @gdevenyi

Is there a particular rationale for the level of padding when creating the bootstrapped COM initial average? It takes images and ultimately pads them by 40 pixels.

I know the padding doesn't harm anything image-wise, but it certainly causes my mouse templates to seem extremely zoomed out and harder to see.

gdevenyi commented 1 year ago

The padding is to ensure sufficiently large FOV to allow the larger scale blurs to extend far enough out. With unknown input images and padding it's safer.

For any model organism with a reference space, I suggest starting with a reference image to determine FOV and resolution.

For mice we use DSUQE space

http://repo.mouseimaging.ca/repo/DSURQE_40micron

araikes commented 1 year ago

Makes sense. This would resample to the 40 micron size though, yes? Would --starting-target-resolution (or whatever the flag is.. i know it's there) 0.075 use the DSURQE space and resample back to my image resolution before building?

gdevenyi commented 1 year ago

This would resample to the 40 micron size though, yes?

Yes

Would --starting-target-resolution (or whatever the flag is.. i know it's there) 0.075 use the DSURQE space and resample back to my image resolution before building?

No, --starting-average-resolution just resamples the starting average constructed: --starting-average-resolution: If no starting target is provided, an average is constructed from all inputs, resample average to a target resolution MxNxO before modelbuild (no default)

If providing a --starting-target the user is expected to set the FOV and resolution of the starting target appropriately.

ResampleImage here is useful to resample the DSURQE atlas to an appropriate resolution for your starting target:

Usage: ResampleImage imageDimension inputImage outputImage MxNxO [size=1,spacing=0] [interpolate type] [pixeltype]
  Interpolation type: 
    0. linear (default)
    1. nn 
    2. gaussian [sigma=imageSpacing] [alpha=1.0]
    3. windowedSinc [type = 'c'osine, 'w'elch, 'b'lackman, 'l'anczos, 'h'amming]
    4. B-Spline [order=3]
 pixeltype  :  TYPE 
  0  :  char   
  1  :  unsigned char   
  2  :  short   
  3  :  unsigned short   
  4  :  int   
  5  :  unsigned int   
  6  :  float (default)  
  7  :  double 
araikes commented 1 year ago

Works for me. Thanks.