CoBrALab / antsRegistration-MAGeT

A reimplementation of MAGeTbrain using only ANTs tools.
Other
16 stars 6 forks source link

Auto-generate QC with ANTs tools? #66

Closed gdevenyi closed 7 years ago

gdevenyi commented 7 years ago

How?

gdevenyi commented 7 years ago
Usage: ConvertScalarImageToRGB imageDimension inputImage outputImage mask colormap [customColormapFile] [minimumInput] [maximumInput] [minimumRGBOutput=0] [maximumRGBOutput=255] <vtkLookupTable>
  Possible colormaps: grey, red, green, blue, copper, jet, hsv, spring, summer, autumn, winter, hot, cool, overunder, custom
> ConvertScalarImageToRGB 3 /opt/quarantine/resources/nifti/mni_icbm152_nlin_sym_09c/mni_icbm152_t1_tal_nlin_sym_09c_mask.nii /tmp/rgb.nii.gz none red

Investigate custom map format to do nice distinct labels.

and

COMMAND: 
     CreateTiledMosaic
          Render a 3-D image volume with optional Rgb overlay. 

OPTIONS: 
     -i, --input-image inputImageFilename
          Main input is a 3-D grayscale image. 

     -r, --rgb-image rgbImageFilename
          An optional Rgb image can be added as an overlay. It must have the same image 
          geometry as the input grayscale image. 

     -x, --mask-image maskImageFilename
          Specifies the ROI of the RGB voxels used. 

     -a, --alpha value
          If an Rgb image is provided, render the overlay using the specified alpha 
          parameter. 

     -e, --functional-overlay [rgbImageFileName,maskImageFileName,<alpha=1>]
          A functional overlay can be specified using both and rgb image and a mask 
          specifying where that rgb image should be applied. Both images must have the 
          same image geometry as the input image. Optionally, an alpha parameter can be 
          specified.Note that more than one functional overlays can be rendered, the order 
          in which they are specified on the command line matters, and rgb images are 
          assumed to be unsigned char [0,255]. 

     -o, --output tiledMosaicImage
          The output is the tiled mosaic image. Without an RGB overlaywe do not alter the 
          intensity values of the input image. Therefore, the output suffix needs to be 
          associated with a format that supports float images (not .jpg or .png). If one 
          or more RGB overlays are supported then we rescale the input image intensities 
          to also be in the range of [0,255] which permits a .png or .jpg output. 

     -t, --tile-geometry RxC
          The tile geometry specifies the number of rows and columns in the output image. 
          For example, if the user specifies '5x10', then 5 rows by 10 columns of slices 
          are rendered. If R < 0 and C > 0 (or vice versa), the negative value is selected 
          based on direction. 

     -d, --direction 0/1/2/x/y/(z)
          Specifies the direction of the slices. This can be based on the how the image is 
          stored in memory or can be based on how the image is aligned in physical space. 
          If no direction is specified, the z-direction (axial?) is chosen. 

     -p, --pad-or-crop padVoxelWidth
                       [padVoxelWidth,<constantValue=0>]
                       [lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]
          The user can specify whether to pad or crop a specified voxel-width boundary of 
          each individual slice. For this program, cropping is simply padding with 
          negative voxel-widths. If one pads (+), the user can also specify a constant pad 
          value (default = 0). If a mask is specified, the user can use the mask to define 
          the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". 

     -s, --slices Slice1xSlice2xSlice3...
                  numberOfSlicesToIncrement
                  [numberOfSlicesToIncrement,<minSlice=0>,<maxSlice=lastSlice>]
          This option gives the user more control over what slices to use for rendering. 
          The user can specify specific slices for a particular order. Alternatively the 
          user can specify the number slices to increment with the optional specification 
          of which slices to start and end the sequence. A negative value for the 
          numberOfSlicesToIncrement causes rendering in the reverse order. For the third 
          option, minSlice < maxSlice. If a mask is specified, the user can use the mask 
          to define the region, by using the keyword "mask" plus an offset, e.g. "-s 
          [1,mask-3,200]".For the third option, minSlice < maxSlice. 

     -f, --flip-slice flipXxflipY
          Flip individual slice images horizontally and/or vertically, specified e.g. as 
          '0x1' or '1x1'. 

     -g, --permute-axes doPermute
          Permute (or swap) the axes of the individual slice images. 

     -h 
          Print the help menu (short version). 

     --help 
          Print the help menu. 
#Example
> CreateTiledMosaic -i /opt/quarantine/resources/nifti/mni_icbm152_nlin_sym_09c/mni_icbm152_t1_tal_nlin_sym_09c.nii -r /tmp/rgb.nii.gz -a 0.4 -o test.png -f 0x1
gdevenyi commented 7 years ago

test

gdevenyi commented 7 years ago

Merged in QC branch.

gdevenyi commented 7 years ago

Problems with defining area of interest with label masks, eduardo got weird outputs. For now, generate whole-brain

gdevenyi commented 7 years ago

Other problems, ITK's left-right flipping exposed as MINC reading bug.

gdevenyi commented 7 years ago

QC branch merged into main, with removal of masking control for now.