TRiP98 CT command



ct | file / import()   list      dim()             debug
            export()   delete    steps()
            read       display   num()
            write      inspect   eqvpathlength()
            slice()    swap
            window() 
            ctstates()     ctref()      singlect 
            create4DCT()   actstate()   newrefstate() 

Purpose

Handles input and output as well as generation of CT data cubes.

Parameters

file
For read/write specifies the stem of the CT cube's file name (without extension) for input/output, respectively.
Since CT cubes are data cubes they come as a binary <file>.CTX data file together with a text <file>.HED header file.
For export <file> is taken as a prefix.
For the creation of CTs with dim() and steps() <file> is used as a patient name.
For import special file naming conventions apply (see there).
import()
cadslices imports a bunch of CT data slices in Lyon's CADPlan format. cadslicesxy does the same, but for an early version with x running as lines and y running as columns. All slice files need to be specified, wild cards are supported.
isogray imports a bunch of CT data slices in IsoGray format. Only their stem name may be given, and only the files <file>m*.hdr, <file>p*.hdr, <file>m*.sca, <file>p*.sca will be considered.
export(fmt)
Exports the current CT cube in some other format.

With cadslices
the CT is exported in Lyon's CADPlan format.

With gd
data are exported to be plotted with the gd program. Depending on window() or slice() data are exported as a single 1-dim file, a 2-dim file or a series of 2-dim files. File naming convention is:
<prefix>ct.gd,
and
<prefix>ct.um<yyyyyy>.gd,
for 1D and 2D files, respectively, where <yyyyyy> is the slice coordinate (centre) in micrometers. <prefix> is either given by file or, if omitted, derived from either the patient name or, if omitted, from the original input file name.

With ctnum.gd
the CT number (HU or equivalent path) distribution is exported to be plotted with the gd program. window() or slice() are taken into account. File naming convention is:
<prefix>ctnum.gd,
If a HLUT is loaded, the corresponding distribution (equivalent path or HU) is also filed.
read
Read CT data specified by file

4D CASE:
Even the "ct /read" command is not new, it is now able to read a 4D-CT. For a 4D-CT it must be used in combination with the two new flags ctstates and ctref, which give further needed information.
write
Writes the current CT cube as specified by file File naming convention is
<file>.ctx, <file>.hed,
or, if file is omitted:
<patient-id>000.ctx, <patient-id>000.hed,
window(xmin,xmax,ymin,ymax,zmin,zmax)
Consider only the specified interval of CT-coordinates for export(). A * may be used to specify the lower/upper limit, respectively.
Note that with version 1310 and above the specified coordinates are treated slightly different than before. The voxel range considered is now determined by the voxels in which the respective coordinate limits are located. Before 1310, the coordinate limits had to enclose at least the numerical voxel centre in order for a voxel to be considered, which could lead to "empty" voxel ranges and thus to missing output.
slice(interval)
Consider only the specified interval of slice numbers for export(). <interval> might be
*
<slice-number>
<low-slice>,<high-slice>
*,<high-slice>
<low-slice>,*
where * stands for "all" or the lower/upper limit, respectively.
list
Show some internal info about the currently loaded CT data.
delete
Deletes the current CT cube from memory (not from file).
display
Displays the current CT cube. Not yet implemented.
inspect
Show some internal info about the current CT cube.
swap
When a CT cube is written, the bytes are swapped.
dim(nx,ny,nz) steps(dx,dy,dz)
When used together with either the num() or the eqvpathlength() parameters a CT cube is generated in memory. <nx,ny,nz> specifies a list of three numbers denoting the number of voxels in the three dimensions. <dx,dy,dz> specifies a list of three numbers denoting the voxel sizes (in mm) in the three dimensions. Note that the file parameter must also be given in order to assign a patient name.
num(hf)
When used together with the dim() and the steps() parameters a CT cube is generated in memory. If <hf> can be interpreted as a reasonable Hounsfield number (hf>=-1000) it will be assumed as a constant value for all CT voxels. Otherwise <hf> is assumed to be the name of a user-supplied executable (plug-in) which calculates the Hounsfield numbers.
eqvpathlength(len)
When used together with the dim() and the steps() parameters a CT cube is generated in memory. If <len> can be interpreted as a reasonable equivalent path length (len>0) it will be assumed as a constant value for all CT voxels. Otherwise <len> is assumed to be the name of a user-supplied executable (plug-in) which calculates the equivalent path lengths.
debug
Debug switch. Lots of output !
ctstates()
Ctstates spezifies the amount of states of the 4D-CT. The information is needed for creating the file names. It must be used in combination with the "read" flag.
ctref()
One of the 4D-CT states is marked as the reference. It's spezified for compatibility reasons, because this one is used if only a 3D ct is needed and because of a singularity of the DOF transformation, which is not able to transform from any state to another directly. The transformation is splited into to parts: First from source state to ref state and then from ref state to destination state. This is done automatically and here only explained for a better understanding, why the reference state is needed.
singlect
If the singlect command is used, a 4D-CT is loaded, which needs only one cube, because the cube data in every state is the same.
create4DCT
By this flag it is possible to build a 4D-CT from a 3D-CT. A loaded transformation is needed. Further more information, provided by the actstate and newrefstate flag, must be given to build a correct 4D-CT. The cube of the 3D-CT is transformed an saved as new cube for each state.
actstate
This flag gives the information, which state the actual only 3D-CT will be after the conversion into a 4D-CT.
(Use in combination with the "create4dct" flag.)
newrefstate
This flag gives the information, which state will be the reference, if the conversion in a 4D-CT is completed.
(Use in combination with the "create4dct" flag.)

Remark

Note that created CT data cubes based on equivalent path length can only be saved to files when a valid Hounsfield table is loaded !

Examples

  1. ct OTTOT3000 / read
    
    Reads CT data (files OTTOT3000.CTX and OTTOT3000.HED) for patient "OTTOT3".
  2. ct xxxxxx /dim(8,4,2) steps(1,1,1) num(17)
    
    Creates a CT data cube with size 8x4x2, a voxel size of 1 mm in either direction and a constant Hounsfield number of 17.
  3. ct 'CADPLAN/250603007*.txt' /import(cadslices)
    
    Imports CADplan CT slices stored in directory CADPLAN
  4. ct "ISOGRAY/80325" /import(isogray)
    
    Imports IsoGray CT slices 80325m*.hdr, 80325p*.hdr, 80325m*.sca, 80325p*.sca stored in directory ISOGRAY

Examples 4D-CT

  1. Read a 4D CT, actually a sequence of 3D CTs.

    This is a very easy task and can be accomplished by a single command. e.g.:
    ct "/TESTDATA/CT/anonymous4812_RIG" /read ctstates(10) ctref(6)
    It's the classic read command with the two additional parameters, /ctstates() specifying the total number of states, and /ctref() specifying the reference state.
    CT files
    "/TESTDATA/CT/anonymous4812_RIG_00.ctx",
    "/TESTDATA/CT/anonymous4812_RIG_01.ctx",
    ...
    "/TESTDATA/CT/anonymous4812_RIG_09.ctx",
    will be read subsequently.

  2. Create a 4D CT, actually a sequence of 3D CTs, from a 3D CT

    First it's necessary to read a classic 3D CT. e.g.:
    ct "/TESTDATA/CT/A" /read
    Then a transformation is needed to convert the 3D into a 4D CT, e.g.:
    trafo "/TESTDATA/anonymous4812" /read
    will read /TESTDATA/anonymous4812.trf.
    Then:
    ct /create4d /actstate(2) /newrefstate(6)
    creates a sequence of 3D CTs in the current working directory. Note that the parameters /actstate() and /newrefstate() are necessary in addition to /create4d

Last updated: $Id: trip98cmdct.html,v 1.19 2014/02/19 19:16:34 kraemer Exp $
M.Kraemer@gsi.de