Mouse-Imaging-Centre / RMINC

Statistics for MINC volumes: A library to integrate voxel-based statistics for MINC volumes into the R environment. Supports getting and writing of MINC volumes, running voxel-wise linear models, correlations, etc.; correcting for multiple comparisons using the False Discovery Rate, and more. With contributions from Jason Lerch, Chris Hammill, Jim Nikelski and Matthijs van Eede. Some additional information can be found here:
https://mouse-imaging-centre.github.io/RMINC
Other
22 stars 17 forks source link

mincPlotSliceSeries appears to display images in radiological perspective #323

Open rwickens opened 1 month ago

rwickens commented 1 month ago

Hello,

RMINC function mincPlotSliceSeries appears to show images in radiological rather than anatomical perspective.

Surprisingly, my attempts to resolve this by mirror-imaging the brain images beforehand have led to identical results.

How I'm calling the function:

library(RMINC) options(RMINC_flip_image=TRUE) #suggested by Jason Lerch for mac computers; otherwise upside down; see link anatVol <- mincGetVolume("/Users/rwick/Desktop/anat_vol.mnc") stat_path <-mincGetVolume("/Users/rwick/Desktop/stat_vol.mnc") mincPlotSliceSeries(mincArray(anatVol), # the anatomical volume mincArray(stat_path),
anatLow=0, anatHigh=500, # set anatomy thresholds low=0, high=3.5, # set stats thresholds symmetric=F,
begin=20, end=100, legend="t-statistics", dimension = 2)

Command for mirror-imaging the brains beforehand: c3d input_file_path -flip x -o mirrored_file_path

Relevant brain images attached:
neuroImages.zip

I'm using RMINC version 1.5.3.0. on R version 4.1.3 (2022-03-10) on conda (fork of minc-toolkit including native builds for Apple ARM64 architecture link

vfonov commented 1 month ago

https://github.com/vfonov/RMINC/blob/597b17a9bd319f8b3c15ff2718fab1ca84e6e9e9/R/minc_vis2D.R#L642 - it should work with RMINC_flip_image

rwickens commented 1 month ago

Hi @vfonov, I'm already setting RMINC_flip_image=TRUE because otherwise it's upside-down (Jason Lerch seems to suggest that this happens on macs). Any work-arounds?

vfonov commented 1 month ago

check direction_cosines property of spatial coordinates, perhaps your image is stored with flipping coordinate transform. (i.e mincheader <filename>.mnc|grep direction_cosines)

rwickens commented 1 month ago

Thanks, flipping the image using mincresample instead of c3d solved the problem.