PW
          _ _ _                _                                  
__      _(_) | | ___ _ __   __| |_ __ _   _ _ __   ___  _ __ __ _ 
\ \ /\ / / | | |/ _ \ '_ \ / _` | '__| | | | '_ \ / _ \| '__/ _` |
 \ V  V /| | | |  __/ | | | (_| | |  | |_| | |_) | (_) | | | (_| |
  \_/\_/ |_|_|_|\___|_| |_|\__,_|_|   \__,_| .__(_)___/|_|  \__, |
                                           |_|              |___/ 

Peter

Cv

Bil

Hobby
 Links
 Køretøjer
 Modeltog
 Patinering



Interface Specification next up previous
Next: Example data Up: Reslice modules Previous: Reslice modules

Interface Specification

A valid reslicing module is a Matlab function with the following structure (Part of code from Reslice.m).
function imgO=Reslice(Struct,method,sincparms);
%
% function imgO=Reslice(Struct,[method]);
%   
%   Function to reslice an Analyze image using 
%   affine 12-parameter transformation matrix.
%  
% Inputs:
%  
%   Struct has the fields
%   hdrI - input file Analyze header
%   hdrO - output file Analyze header
%   A - 12 parm. affine transformation matrix 
%       for application xyzO=A*xyzI. A is in 
%       real world (mm) coordinates.
%   [imgI] - optional field. If Struct has this field,
%            the input data are taken from here. Otherwise,
%            the image given in hdrI.name is loaded.
%   [imgO] - optional field. If Struct has this field, the output
%            is non-empty, and no datafile is written to disk.
%
%   method - defines what interpolation method to use. If none
%            is given, 'linear' is assumed.
%
% Output:
%   imgO - Output Analyze Img data. only non-empty if the field 
%          'imgO' exists in Struct.
%
%   Warning: Output is written to hdr0.name without checking.
%   Checking should be done beforehand, e.g. using uiputfile.
%   hdr.origin information is assumed correct.
%   
%   
%   Note: A third input parameter - sincparms - is unused, but 
%   needed for concistency whith ResliceWarp and ResliceAir
%
%   PW, NRU, 2001
%

% The following string defines that this is a reslice module. The
% latter part of the string defines what to write on the main interface.

% RESLICEDESC interp3 (Matlab)
  
  % Check for definition of temp area. Defaults to /tmp
  global TEMP_AREA;
  if isempty(TEMP_AREA)
    TEMP_AREA='/tmp';
  end
The following reslice modules are supplied with the PVEOut registration package:
  • warp_reslice (mriwarp) (*)
  • reslice (Air 5.0) (*)
  • interp3 (Matlab built-in)
Note: The modules marked by asterisks (*) require external programs to reslice data. It is generally recommended to use warp_reslice or interp3, since the reslice program from the Air package does not keep correct bit resolution on the resliced images.



Claus Svarer 2006-01-11


Last Modified: Wednesday, 11-Jan-2006 15:26:30 CET