Differences between revisions 8 and 9
Deletions are marked like this. Additions are marked like this.
Line 62: Line 62:
|| --unwarp_gradient_nonlinearity||<sonata | allegra | GE> || <fullUnwarp | through-plane> <JacobianCorrection | noJacobianCorrection> <linear | sinc> <sincInterpHW>|| || --unwarp_gradient_nonlinearity|| <sonata | allegra | GE> || <fullUnwarp | through-plane> <JacobianCorrection | noJacobianCorrection> <linear | sinc> <sincInterpHW>||
|| -r, --reorder olddim1 olddim2 olddim3|| reorder dimensions || Reorders axes such that olddim1 is the new column dimension, olddim2 is the new row dimension, olddim3 is the new slice dimension. Example: 2 1 3 will swap rows and cols.||
|| -invert_contrast threshold || applies threshold || all voxels in volume greater than threshold are replaced with 255-value. Only makes sense for 8 bit images. Only operates on the first frame.||
|| -i, --input_volume|| ||
|| -o, --output_volume|| ||
|| -c, --conform|| conform ||conform to 1mm voxel size in coronal slice direction with 256^3 or more||
|| -cm, --conform_min || conform to the src min direction size|| ||
|| -cs, --conform_size size || conform to the size given in mm || ||
|| -po, --parse_only|| || ||
|| -is, --in_stats|| || ||
|| -os, --out_stats|| || ||
|| -ro, --read_only|| || ||
|| -nw, --no_write|| || ||
|| -sn, --subject_name|| || ||
|| -rl, --reslice_like|| || ||
|| -tt, --template_type <type> || || ||
|| -f, --frame|| || ||
|| -sc, --scale <scale factor>|| || ||
|| -il, --in_like|| || ||
|| -roi|| || ||
|| -fp, --fill_parcellation|| || ||
|| -sp, --smooth_parcellation|| || ||
|| -zo, --zero_outlines|| || ||
|| -cf, --color_file|| || ||
|| -nt, --no_translate|| || ||
|| --status || status file for DICOM conversion|| ||
|| --sdcmlist || list of DICOM files for conversion|| ||
|| -ti, --template_info || dump info about template|| ||
|| -gis <gdf image file stem>|| || ||
|| -zgez, --zero_ge_z_offset || || set c_s=0 (appropriate for dicom files from GE machines with isocenter scanning)||

=== Applying Transforms ===
|| -T, -at, --apply_transform xfmfile || apply tranform given by xfmfile || ||
|| -ait, --apply_inverse_transform xfmfile || apply inverse of tranform given by xfmfile || ||
|| --devolvexfm subjectid || || ||
|| --like vol: output is embedded in a volume like vol|| || ||
Line 71: Line 106:
  cor - MGH-NMR COR format || cor || MGH-NMR COR format ||
|| minc || MNI's Medical Imaging NetCDF format (output may not work) ||
|| analyze || 3D analyze (same as spm)||
|| analyze4d || 4D analyze||
|| spm || SPM Analyze format (same as analyze and analyze3d) ||
|| ge || GE Genesis format (input only)||
|| gelx || GE LX (input only)||
|| lx || same as gelx||
|| ximg || GE XIMG variant (input only)||
|| siemens || Siemens IMA (input only)||
|| dicom || generic DICOM Format (input only)||
|| siemens_dicom || Siemens DICOM Format (input only)||
|| afni || AFNI format||
|| brik || same as afni||
|| bshort || MGH-NMR bshort format||
|| bfloat || MGH-NMR bfloat format||
|| sdt || Varian (?)||
|| outline || MGH-NMR Outline format||
|| otl || same as outline||
|| gdf || GDF volume (requires image stem for output; use -gis)||
Line 73: Line 127:
  minc - MNI's Medical Imaging NetCDF format (output may not work) analyze - 3D analyze (same as spm) Notes:
Line 75: Line 129:
  analyze4d - 4D analyze If the user specifies any of the direction cosines, the ras_good_flag is set.
Line 77: Line 131:
  spm - SPM Analyze format (same as analyze and analyze3d) ge - GE Genesis format (input only)

  gelx - GE LX (input only)

  lx - same as gelx

  ximg - GE XIMG variant (input only)

  siemens - Siemens IMA (input only)

  dicom - generic DICOM Format (input only)

  siemens_dicom - Siemens DICOM Format (input only)

  afni - AFNI format

  brik - same as afni

  bshort - MGH-NMR bshort format

  bfloat - MGH-NMR bfloat format

  sdt - Varian (?)

  outline - MGH-NMR Outline format

  otl - same as outline

  gdf - GDF volume (requires image stem for output; use -gis)

= Examples =
== Example 1 ==
APPLYING TRANSFORMS (INCLUDING TALAIRACH)

  --apply_transform xfmfile (-T or -at)

  --apply_inverse_transform xfmfile (-ait)

  --devolvexfm subjectid :

  --like vol: output is embedded in a volume like vol

 The volume can be resampled into another space by supplying a transform using the --apply_transform flag. This reads the transform file and applies the transform (when --apply_inverse_transform is used, the transform is inverted and then applied). An example of a transform file is talairach.xfm as found in subjectid/mri/transforms. To convert a subject's orig volume to talairach space, execute the following lines:

  cd subjectid/mri

  mkdir talairach

  mri_convert --apply_transform transforms/talariach.xfm
     --devolvexfm subjectid --ic 0 0 0
     orig talairach

 This properly accounts for the case where the input volume does not have it's coordinate center at 0.

 To evaluate the result, run:

    tkmedit -f $SUBJECTS_DIR/talairach/mri/orig -aux talairach

 The main and aux volumes should overlap very closely. If they do not,
 use tkregister2 to fix it (run tkregister --help for docs).

== Example 2 ==
Line 147: Line 139:
= Examples =
== Example 1 ==
APPLYING TRANSFORMS (INCLUDING TALAIRACH)


The volume can be resampled into another space by supplying a transform using the --apply_transform flag. This reads the transform file and applies the transform (when --apply_inverse_transform is used, the transform is inverted and then applied). An example of a transform file is talairach.xfm as found in subjectid/mri/transforms. To convert a subject's orig volume to talairach space, execute the following lines:

  cd subjectid/mri

  mkdir talairach

  mri_convert --apply_transform transforms/talariach.xfm --devolvexfm subjectid --ic 0 0 0 orig talairach

This properly accounts for the case where the input volume does not have it's coordinate center at 0.

To evaluate the result, run:

    ["tkmedit"] -f $SUBJECTS_DIR/talairach/mri/orig -aux talairach

The main and aux volumes should overlap very closely. If they do not, use ["tkregister2"] to fix it (run tkregister --help for docs).

== Example 2 ==
??
Line 149: Line 165:

= Other Available Options =
-r, --reorder olddim1 olddim2 olddim3

  Reorders axes such that olddim1 is the new column dimension,
  olddim2 is the new row dimension, olddim3 is the new slice
  dimension. Example: 2 1 3 will swap rows and cols.

  --invert_contrast threshold

  All voxels in volume greater than threshold are replaced
  with 255-value. Only makes sense for 8 bit images.
  Only operates on the first frame.


  -i, --input_volume

  -o, --output_volume

  -c, --conform
            conform to 1mm voxel size in coronal slice direction with 256^3 or more

  -cm, --conform_min
            conform to the src min direction size

  -cs, --conform_size size_in_mm
            conform to the size given in mm

  -po, --parse_only

  -is, --in_stats

  -os, --out_stats

  -ro, --read_only

  -nw, --no_write

  -sn, --subject_name

  -rl, --reslice_like

  -tt, --template_type <type> (see above)

  -f, --frame

  -sc, --scale <scale factor>

  -il, --in_like

  -roi

  -fp, --fill_parcellation

  -sp, --smooth_parcellation

  -zo, --zero_outlines

  -cf, --color_file

  -nt, --no_translate

  --status (status file for DICOM conversion)

  --sdcmlist (list of DICOM files for conversion)

  -ti, --template_info : dump info about template

  -gis <gdf image file stem>

  -zgez, --zero_ge_z_offset

            set c_s=0 (appropriate for dicom files from GE machines with isocenter scanning)

Notes:

If the user specifies any of the direction cosines, the ras_good_flag is set.
Line 236: Line 174:
description
description
N/A
Line 241: Line 178:
None

Navigation(children) Index TableOfContents

Name

mri_convert - converts MRI data format/file type

Synopsis

mri_convert [<options>] involume outvolume

Arguments

Positional Arguments

involume

input volume

outvolume

output volume

Required Flagged Arguments

None

Optional Flagged Arguments

-ro, --read_only

-nw, --no_write

-ii, --in_info

-oi, --out_info

-is, --in_stats

-os, --out_stats

-im, --in_matrix

-om, --out_matrix

-iis, --in_i_size <size>

-ijs, --in_j_size <size>

-iks, --in_k_size <size>

--force_ras_good

use default when orientation info absent

-iid, --in_i_direction <R direction> <A direction> <S direction>

-ijd, --in_j_direction <R direction> <A direction> <S direction>

-ikd, --in_k_direction <R direction> <A direction> <S direction>

-ic, --in_center <R coordinate> <A coordinate> <S coordinate>

-oni, -oic, --out_i_count <count>

-onj, -ojc, --out_j_count <count>

-onk, -okc, --out_k_count <count>

-ois, --out_i_size <size>

-ojs, --out_j_size <size>

-oks, --out_k_size <size>

--nskip n : skip the first n frames

-oid, --out_i_direction <R direction> <A direction> <S direction>

-ojd, --out_j_direction <R direction> <A direction> <S direction>

-okd, --out_k_direction <R direction> <A direction> <S direction>

-oc, --out_center <R coordinate> <A coordinate> <S coordinate>

-odt, --out_data_type <uchar|short|int|float>

-rt, --resample_type <interpolate|weighted|nearest|sinc|cubic> (default is interpolate)

--no_scale flag <-ns>: 1 = dont rescale values for COR

-nc --nochange - don't change type of input to that of template

-tr TR : TR in seconds

--unwarp_gradient_nonlinearity

<sonata | allegra | GE>

<fullUnwarp | through-plane> <JacobianCorrection | noJacobianCorrection> <linear | sinc> <sincInterpHW>

-r, --reorder olddim1 olddim2 olddim3

reorder dimensions

Reorders axes such that olddim1 is the new column dimension, olddim2 is the new row dimension, olddim3 is the new slice dimension. Example: 2 1 3 will swap rows and cols.

-invert_contrast threshold

applies threshold

all voxels in volume greater than threshold are replaced with 255-value. Only makes sense for 8 bit images. Only operates on the first frame.

-i, --input_volume

-o, --output_volume

-c, --conform

conform

conform to 1mm voxel size in coronal slice direction with 256^3 or more

-cm, --conform_min

conform to the src min direction size

-cs, --conform_size size

conform to the size given in mm

-po, --parse_only

-is, --in_stats

-os, --out_stats

-ro, --read_only

-nw, --no_write

-sn, --subject_name

-rl, --reslice_like

-tt, --template_type <type>

-f, --frame

-sc, --scale <scale factor>

-il, --in_like

-roi

-fp, --fill_parcellation

-sp, --smooth_parcellation

-zo, --zero_outlines

-cf, --color_file

-nt, --no_translate

--status

status file for DICOM conversion

--sdcmlist

list of DICOM files for conversion

-ti, --template_info

dump info about template

-gis <gdf image file stem>

-zgez, --zero_ge_z_offset

set c_s=0 (appropriate for dicom files from GE machines with isocenter scanning)

Applying Transforms

-T, -at, --apply_transform xfmfile

apply tranform given by xfmfile

-ait, --apply_inverse_transform xfmfile

apply inverse of tranform given by xfmfile

--devolvexfm subjectid

--like vol: output is embedded in a volume like vol

Outputs

outvolume

output volume

Description

mri_convert is a general purpose utility for convertin between different file formats. The file type can be specified in two ways. First, mri_convert will try to figure it out on its own from the format of the file name (eg, files thatend in .img are assumed to be in spm analyze format). Second, the user canexplicity set the type of file using --in_type and/or --out_type. Legal values for --in_type (-it) and --out_type (-ot) are:

cor

MGH-NMR COR format

minc

MNI's Medical Imaging NetCDF format (output may not work)

analyze

3D analyze (same as spm)

analyze4d

4D analyze

spm

SPM Analyze format (same as analyze and analyze3d)

ge

GE Genesis format (input only)

gelx

GE LX (input only)

lx

same as gelx

ximg

GE XIMG variant (input only)

siemens

Siemens IMA (input only)

dicom

generic DICOM Format (input only)

siemens_dicom

Siemens DICOM Format (input only)

afni

AFNI format

brik

same as afni

bshort

MGH-NMR bshort format

bfloat

MGH-NMR bfloat format

sdt

Varian (?)

outline

MGH-NMR Outline format

otl

same as outline

gdf

GDF volume (requires image stem for output; use -gis)

Notes:

If the user specifies any of the direction cosines, the ras_good_flag is set.

CONVERTING TO SPM-ANALYZE FORMAT

Converting to SPM-Analyze format can be done in two ways, depeding uponwhether a single frame or multiple frames are desired. For a single frame,simply specify the output file name with a .img extension, and mri_convert will save the first frame into the file. For multiple frames, specify the base as the output file name and add --out_type spm. This will save each frame as baseXXX.img where XXX is the three-digit, zero-padded frame number. Frame numbers begin at one. By default, the width the of zero padding is 3.This can be controlled with --in_nspmzeropad N where N is the new width.

Examples

Example 1

APPLYING TRANSFORMS (INCLUDING TALAIRACH)

The volume can be resampled into another space by supplying a transform using the --apply_transform flag. This reads the transform file and applies the transform (when --apply_inverse_transform is used, the transform is inverted and then applied). An example of a transform file is talairach.xfm as found in subjectid/mri/transforms. To convert a subject's orig volume to talairach space, execute the following lines:

  • cd subjectid/mri mkdir talairach mri_convert --apply_transform transforms/talariach.xfm --devolvexfm subjectid --ic 0 0 0 orig talairach

This properly accounts for the case where the input volume does not have it's coordinate center at 0.

To evaluate the result, run:

  • ["tkmedit"] -f $SUBJECTS_DIR/talairach/mri/orig -aux talairach

The main and aux volumes should overlap very closely. If they do not, use ["tkregister2"] to fix it (run tkregister --help for docs).

Example 2

??

Bugs

None

See Also

["mris_convert"]

Links

FreeSurfer, FsFast

Methods Description

N/A

References

None

Reporting Bugs

Report bugs to <analysis-bugs@nmr.mgh.harvard.edu>

Author/s

YasunariTosa, DougGreve, BruceFischl

mri_convert (last edited 2017-11-29 12:05:15 by MorganFogarty)