Difference between revisions of "Warping VOI masks"

From SpanLabWiki
Jump to: navigation, search
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
For information on the mask type and mask creation, see [[Making VOI]]. After making a mask using the draw dataset plugin, the mask is usually in +tlrc and is sampled at 1mm. In order to accurately dump timecourse data from these regions, the mask must be warped an resampled. For the sake of storage contraints and accuracy, the adwarp command should no longer be used. Adwarp typically would involve a non-optimal, additional manipulation step on the functional dataset. Instead 3dfractionize should be used only on the mask file to down warp the mask to +orig and resample to match the functional dataset space (usually 3.75mm 3.75mm 4.00mm). The mask just created must be re-sampled to match the resolution of the functional data instead of the anatomical, so run 3dresample at the command line as follows:
+
For information on the mask type and mask creation, see [[Making VOI masks]].  
  
Individual VOI Masks: Custom placed VOIs based on Individual Anatomy
+
After making a mask using the draw dataset plugin, the mask is typically in +tlrc space and is usually sampled at 1mm. In order to accurately dump timecourse data from these regions, the mask must be warped and resampled. For the sake of storage contraints and accuracy, the adwarp command should no longer be used. Adwarp typically would involve a non-optimal, additional manipulation step on the functional dataset. Instead, 3dfractionize and 3dresample should be used only on the mask file to down-warp the mask to +orig and resample to match the functional dataset space (usually 3.75mm 3.75mm 4.00mm).
  
  
$ 3dresample -dxyz DX DY DZ -prefix [output resampled mask name] -inset [input mask]
+
<b>Canonical VOI Masks and Individual VOI Masks (in tlrc space):</b>
  
e.g.
+
$ 3dfractionize -template [subject's functional dataset +orig] -input [mask file +tlrc] -warp [subject's sag116+tlrc]
 +
  -clip 0.1 -preserve -prefix [output, append 'r' to input mask name +orig]
 +
e.g.
 +
$ 3dfractionize -template zmidantoutreg+orig -input apVOImask+tlrc -warp sag116+tlrc -clip 0.1 -preserve -prefix   
 +
  apVOImaskr+orig
  
$ 3dresample -dxyz 2.0 2.0 2.0 -prefix maskname -inset maskunsampfile+tlrc
+
Notes:
 +
-Make sure you use subject specific files for warp and template. The template should be functional dataset you will eventually dump data from.  
  
Maskname is your final output mask to use in your timecourse dump.
+
-Use exact coordinate spaces specified above (+tlrc/+orig)
  
Note that the syntax here is a bit different. Adwarp’s dxyz flag takes only one argument, here you have to specify each direction.
+
-Clip should not be changed unless you notice that too much or not enough of the starting mask size is removed. Increase to clip additional voxels, decrease to restore.  
  
note:
+
-When the command is executed you should end with a maskfile that is resampled to the functional dataset coordinate space and down-warped to +orig space. You can verify this by using the 3dinfo command in terminal on the output mask file.
If you open an old mask in order to add new ROIs, it won't usually work (unless you do unknown tricks). So, you have to make a whole new mask with the old ROIs and the new ones.
+
 
 +
 
 +
<b>Masks made in Original Space:</b>
 +
 
 +
In some cases your mask may be made in original space (some individual masks). Warping is unnecessary since the mask is already in +orig space. However, they do need to be resampled to match the functional dataset that will be used to dump from. It is very important that you use the correct dimensions in the -dxyz option. Running 3dinfo on the functional dataset will provide the correct dimensions (usually, 3.75 3.75 4.0). Output will be a mask file in +orig space that has voxels that are the same dimensions as the functional dataset.
 +
 
 +
$ 3dresample -orient LPI -dxyz DX DY DZ -prefix [output, append 'r' to input mask name] -inset [input mask +orig]
 +
e.g.
 +
$ 3dresample -orient LPI -dxyz 3.75 3.75 4.00 -prefix apVOImaskr -inset apVOImask+orig

Latest revision as of 15:04, 13 June 2024

For information on the mask type and mask creation, see Making VOI masks.

After making a mask using the draw dataset plugin, the mask is typically in +tlrc space and is usually sampled at 1mm. In order to accurately dump timecourse data from these regions, the mask must be warped and resampled. For the sake of storage contraints and accuracy, the adwarp command should no longer be used. Adwarp typically would involve a non-optimal, additional manipulation step on the functional dataset. Instead, 3dfractionize and 3dresample should be used only on the mask file to down-warp the mask to +orig and resample to match the functional dataset space (usually 3.75mm 3.75mm 4.00mm).


Canonical VOI Masks and Individual VOI Masks (in tlrc space):

$ 3dfractionize -template [subject's functional dataset +orig] -input [mask file +tlrc] -warp [subject's sag116+tlrc] 
  -clip 0.1 -preserve -prefix [output, append 'r' to input mask name +orig]
e.g.
$ 3dfractionize -template zmidantoutreg+orig -input apVOImask+tlrc -warp sag116+tlrc -clip 0.1 -preserve -prefix    
  apVOImaskr+orig

Notes: -Make sure you use subject specific files for warp and template. The template should be functional dataset you will eventually dump data from.

-Use exact coordinate spaces specified above (+tlrc/+orig)

-Clip should not be changed unless you notice that too much or not enough of the starting mask size is removed. Increase to clip additional voxels, decrease to restore.

-When the command is executed you should end with a maskfile that is resampled to the functional dataset coordinate space and down-warped to +orig space. You can verify this by using the 3dinfo command in terminal on the output mask file.


Masks made in Original Space:

In some cases your mask may be made in original space (some individual masks). Warping is unnecessary since the mask is already in +orig space. However, they do need to be resampled to match the functional dataset that will be used to dump from. It is very important that you use the correct dimensions in the -dxyz option. Running 3dinfo on the functional dataset will provide the correct dimensions (usually, 3.75 3.75 4.0). Output will be a mask file in +orig space that has voxels that are the same dimensions as the functional dataset.

$ 3dresample -orient LPI -dxyz DX DY DZ -prefix [output, append 'r' to input mask name] -inset [input mask +orig]
e.g.
$ 3dresample -orient LPI -dxyz 3.75 3.75 4.00 -prefix apVOImaskr -inset apVOImask+orig