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

mincPlotSliceSeries appears to display images in radiological perspective #323

Open
rwickens opened this issue Jul 19, 2024 · 4 comments
Open

Comments

@rwickens
Copy link

rwickens commented Jul 19, 2024

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
Copy link
Contributor

vfonov commented Jul 20, 2024

@rwickens
Copy link
Author

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
Copy link
Contributor

vfonov commented Jul 21, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants