User Tools

Site Tools


vmr.createvtc
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


vmr.createvtc [2010/08/11 13:35] (current) – created jochen
Line 1: Line 1:
 +====== vmr.CreateVTC ======
 +
 +===== Motivation =====
 +The main motivation for using this function is the ability to flexibly script VTC creation from FMR files using transformation files created in BrainVoyager QX (coregistration initial and fine alignment, as well as ACPC and TAL normalization files).
 +
 +===== Method reference ('vmr.Help('CreateVTC')') =====
 +<file> VMR::CreateVTC  - mimick BV's VTC creation
 + 
 + FORMAT:       [vtc] = vmr.CreateVTC(fmr, afs, vtcfile, res, meth, bbox, dt);
 + 
 + Input fields:
 + 
 +       fmr         FMR object to create VTC from
 +       afs         cell array: alignment file objects ({ia, fa, acpc, tal})
 +       vtcfile     filename of output VTC
 +       res         resolution (default: 3)
 +       meth        interpolation, 'cubic', 'lanczos3', {'linear'}, 'nearest'
 +       bbox        2x3 bounding box (optional, default: small TAL box)
 +       dt          datatype override (default: uint16, FV 2)
 + 
 + Output fields:
 + 
 +       vtc         VTC object</file>
 +
 +===== Usage example =====
 +To load files manually and then creating a VTC, the following code can be used:
 +
 +<code matlab vmr_createvtc_manual.m>% load the required files
 +vmr = xff('*.vmr', 'Please select the VMR file to use as a reference...');
 +fmr = xff('*.fmr', 'Please select the FMR file to sample into VTC space...');
 +ia = xff('*IA*.trf', 'Please select the initial alignment (_IA.trf) file...');
 +fa = xff('*FA*.trf', 'Please select the fine alignment (_FA.trf) file...');
 +acpc = {xff('*ACPC*.trf', 'Please select the ACPC transformation file...')};
 +if ~isempty(acpc{1})
 +    tal = {xff('*.tal', 'Please select the TAL transformation file...')};
 +    if isempty(tal{1})
 +        tal = {};
 +        space = '_ACPC';
 +    else
 +        space = '_TAL';
 +    end
 +else
 +    acpc = {};
 +    space = '';
 +end
 +
 +% make a call to vmr.CreateVTC (will save VTC already!)
 +vtc = vmr.CreateVTC(fmr, {ia, fa, acpc{:}, tal{:}}, ...
 +    strrep(fmr.FilenameOnDisk, '.fmr', [space '.vtc']), ...
 +    3, 'cubic', [], 2);
 +
 +% clear objects
 +xffclearobjects({vtc, tal{:}, acpc{:}, fa, ia, fmr, vmr});</code>
  
vmr.createvtc.txt · Last modified: 2010/08/11 13:35 by jochen