This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFNI 3dmaskdump INPUT | |
------------------------------------------------ | |
Appears to use system rounding rint() to convert coordinate floats to integers: | |
If user inputs mm coordinates as 3dmaskdump argument, 3dmaskdump converts them to | |
integer "index coordinates" using serial calls to three functions: | |
1) THD_dicomm_to_3dmm() (from thd_coords.c) | |
2) THD_3dmm_to_3dfind() (from thd_coords.c) | |
3) rint() (from system's buit-in c math, or from faked version in mri_free.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFNI 3dmaskdump OUTPUT: | |
------------------------------------------------ | |
Appears to use implicit casting and a custom log-based algorithm to convert | |
coordinate floats to integers: | |
If user requests integer voxel coordinates (not mm), 3dmaskdump creates them | |
from internal float voxel coordinates (not mm) using functions in multivector.c: | |
MV_format_fval(), which calls MV_fval_to_char() | |
e.g., here 3dmaskdump calls for outputting integer voxel coordinate ijk: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFNI controller window user INPUT | |
------------------------------------------------ | |
Appears to use implicit casting + boundary handling to create integer voxel | |
coordinates from the user-specified mm coordinates in the "Jump to (xyz)" box: | |
In afni.c , typical use of AFNI_jumpto_dicom() calls AFNI_jumpto_dicom_OLD(), | |
which converts user-provided mm coordinates to integer voxel coordinates in | |
three steps: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFNI controller window OUTPUT | |
------------------------------------------------ | |
Appears to pull existing integer voxel coordinates from internal integer-based | |
data structures. Doesn't need conversion from float to integer. | |
When the AFNI controller window is set to display voxel coordinates for the | |
current crosshair location (GUI "Set Coord Order"->"Voxel Indexes"), it displays | |
integer coordinates pulled from internal integer data structures. | |
from afni.c : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FSL fslview cursor widget | |
------------------------------------------------ | |
Appears to use explicit casting to convert float mmm coordinates to integer | |
voxel coordinates, truncating in the process: | |
line 266 from fslview's cursorwidget.cpp: | |
232 void CursorWidget::mmBoxChanged() | |
233 { | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FSL fslmeants INPUT | |
------------------------------------------------ | |
Appears to round coordinate floats to integers via MISCMATHS::round | |
(adding or subtracting .5 then truncating decimal via cast): | |
If user inputs mm coordinates as fslmeants argument (-c --usemm), fslmeants | |
rounds to integer voxel coordinates using call to MISCMATHS::round(). | |
From fslmeants.cc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FSL fslmeants OUTPUT | |
------------------------------------------------ | |
If user requests voxel coordinate output (not mm) via fslmeants --showall, | |
fslmeants doesn't appear to convert floats to integers. It just matrix | |
transforms internal voxel coordinates (which already lack decimal values due to | |
their row/slice/column nature) to nifti voxel coordinates. | |
From fslmeants.cc: | |
311 if (showall.value()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 3dinfo ~/Downloads/ftp.medimg.emory.edu/NMCardiac/JonNye/PiB_binding_maps/NIFTI/VN040_20110412_LI_rsl.nii | |
++ 3dinfo: AFNI version=AFNI_2011_12_21_1014 (Dec 1 2012) [64-bit] | |
Dataset File: /home/stowler-local/Downloads/ftp.medimg.emory.edu/NMCardiac/JonNye/PiB_binding_maps/NIFTI/VN040_20110412_LI_rsl.nii | |
Identifier Code: NII_MVGvk3_9itSHbYxclrBKWw Creation Date: Tue Apr 23 12:23:56 2013 | |
Template Space: ORIG | |
Dataset Type: Anat Bucket (-abuc) | |
Byte Order: LSB_FIRST {assumed} [this CPU native = LSB_FIRST] | |
Storage Mode: NIFTI | |
Storage Space: 25,090,560 (25 million) bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# CALL AS: lut_convertToFslview.sh | |
# (no arguments: input and output files defined below) | |
# | |
# CREATED: 20130430 by [email protected] | |
# LAST UPDATED: same | |
# | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A short proof-of-concept script for meeting with Pearce and Evan (W, 20130501) | |
# | |
# Demonstrates adaptation of existing tools for automated PET->T1->MNI152 | |
# registration. | |
# | |
# INPUT: dicoms for a deidentified participant's T1 and PET sequences. | |
# | |
# OUTPUT: PET and T1 nifti volumes nonlinearly registered to MNI152 template (RPI). |
OlderNewer