Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.


source files: xvol.[ch]


    :VOXELS  <grl:voxels>
  [ :AXIS    <fix:axis>    ]
  [ :SRC-MIN <flo:src-min> ]
  [ :SRC-MAX <flo:src-max> ]
  [ :DST-MIN <flo:dst-min> ]
  [ :DST-MAX <flo:dst-max> ]
  [ :ZERO-REST { t | nil } ]


The interval of slices [src-min,src-max] is resampled to fill the interval of slices [dst-min,dst-max]:

This function is intended primarily as a fairly special-purpose hack for scaling a volume dataset to be nicely cubical. 'voxels' will typically be (256 256 256) with an (N 256 256) set of slices loaded.

'voxels' should be either a rank-three CLASS-16-BIT-FLOAT-ARRAY or else a graphic relation holding such an array, named :INTENSITY.

'Axis' indicates which direction the slice should be taken. It should be 0, 1 or 2, and defaults to 0.

If :ZERO-REST is nil (the default) then voxels not part of the destination range are left unchanged. This can be useful, but can also (for example, when compressing the array slighly) result in unwanted bits of the input left in the voxel array; setting :ZERO-REST non-nil results in the zeroing of all voxels not part of the destination range.

The src-min, src-max, dst-min and dst-max parameters take values in [0,1] and specify the range to sample from and the range in which to store the results: to enlarge the first half of the volume to fill the entire volume, specify

  :SRC-MIN 0.0
  :SRC-MAX 0.5
  :DST-MIN 0.0
  :DST-MAX 1.0

Rationale: sampling ranges are given as a parametric values rather than as an absolute voxel counts in order to encourage scale-independent coding, to facilitate testing code at reduced resolution (128x128x128, say) and then applying it at full resolution (256x256x256, perhaps).

The :FILTER-SHAPE parameter may be used to control the quality of resampling done; IMPULSE (simple pixel copying) is fastest but produces poor results; the remaining filters produce successively better results at the cost of running successively slower. The :TRIANGLE filter seems a good compromise.

Go to the first, previous, next, last section, table of contents.