0% found this document useful (0 votes)
30 views45 pages

Data Utility

Uploaded by

Martin Venich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views45 pages

Data Utility

Uploaded by

Martin Venich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Data Utility

User’s Guide
Version 2.0

Fortner Research LLC


Data Utility User’s Guide

Revised March, 1996

Fortner Research LLC


100 Carpenter Drive
Sterling, VA 20164

Phone: (703) 478-0181


Fax: (703) 689-9593
Email: [email protected]
Web: http://www.fortner.com

© Copyright 1990-1996 by Fortner Research LLC. All rights reserved.

Apple, Balloon Help, Finder, QuickTime, MPW, Macintosh, Power Macintosh, and SimpleText are trademarks of Apple
Computer, Inc. PowerPC is a trademark of International Business Machines Corporation. Sequent is a trademark of Sequent
Computer Systems. THINK C, THINK Reference and THINK Pascal are trademarks of Symantec Corporation. UNIX is a registered
trademark of Novell, Inc. VAX/VMS is a registered trademark of Digital Equipment Corporation. All other brand and product
names are trademarks or registered trademarks of their respective companies.
CHAPTER 1 Introduction

Welcome to the documentation for the Data Utility 2.0! This utility lets you
convert data from a wide variety of formats into Slicer-compatible 3D or 4D
datasets.

3
Data Utility User’s Guide

1.1 What is the Data Utility?


The Data Utility takes either Matrix or Column data in the forms listed below
and converts them into Slicer-compatible datasets:
3D Matrix Files and Folders of 3D Matrix Files
Converts 3D HDF files, PICS files, FITS files, ASCII
Text Matrix files, and Binary Matrix files.
Folders of 2D Matrix Files
Converts 2D HDF files, PICT files, TIFF files, FITS files,
GIF files, XWD files, PBM files, MATLAB files, ASCII
Text Matrix files, and Binary Matrix files.
Column Files Converts ASCII Text Column files, Binary Column
files, PLOT3D files, and HDF VSET files.

1.2 How Do I Get Started?


The first step is identifying whether your input datafiles are 3D Matrix files, 2D
Matrix files, or Column files. The next step is clicking Single File… for reading
a single input file, or clicking Folder… for reading a folder containing a series
of datafiles. Then follow the directions in the appropriate Chapter in this
document: Chapter Two for 3D Matrix files, Chapter Three for 2D Matrix files,
or Chapter Four for Column files.

1.3 What is the Difference Between Matrix


and Column Files?
A column file consists of a series of columns of numbers. Two or three of these
columns define the X, Y, and possibly Z locations of the data values. The other
columns consist of data values. Column files are usually ASCII Text, although
the data utility also supports binary column datafiles. An example column file
is shown below:

4 CHAPTER 1: Introduction
Data Utility User’s Guide

A matrix file consists of a 2D or 3D array of numbers. The X, Y, and possibly Z


locations of the data values are implicit in the location of the data values in the
array. Below is an example of a 2D Matrix file, along with X and Y values for
each column and row in the array

1.4 What is the Difference between 2D Matrix


and 3D Matrix Files?
A 2D Matrix file contains a 2D array of data values, as shown in the figure
above. Two location values, in the case shown above an X and a Y value, are
associated with each data value in the 2D array. Images such as photographs
or single MRI scans are considered 2D Matrix files.
A 3D Matrix file contains a 3D array of data values, as shown in the figure
below. Three location values, in the case shown below an X, a Y, and a Z value
are associated with each data value in the 3D array. 3D Matrix datafiles are
often called ‘Volumetric Datasets’

What is the Difference between 2D Matrix and 3D Matrix Files? 5


Data Utility User’s Guide

6 CHAPTER 1: Introduction
CHAPTER 2 Converting 3D Matrix Files
or Folders of 3D Files

You can convert a single 3D Matrix file into a Slicer-compatible 3D dataset, or


convert a folder containing a series of 3D Matrix datasets into a single Slicer-
compatible 4D dataset. 4D datasets are used to create ‘time animations’ (see
Chapter 9 in the Slicer manual). You need to do the following steps to convert
your data:
• Specify your input datafile/folder and file type (many file types are
recognized automatically).
• Specify the input file format (for ASCII Matrix and Binary Matrix files only).
• Specify the output file format (byte, float) and name.
Each step is discussed in detail below.

2.1 Supported 3D Matrix File Types


The following 3D Matrix file types are supported:
3D HDF The data utility reads HDF 3D scientific datasets in
byte, integer, or floating point format. It also
supports a series of 2D HDF scientific datasets or 2D
image datasets stored in the same HDF file.
PICS A PICS file consists of an animation file of PICT
images. You can select some or all of the PICT
images in the file to create a single 3D dataset.

Supported 3D Matrix File Types 7


Data Utility User’s Guide

FITS (Flexible Image Transport System)


The data utility reads 3D 8-bit unsigned, and 16-bit
and 32-bit signed integer datafiles, as well as
single- and double-precision floating point datafiles.
ASCII Text Matrix You can read datasets containing a 3D Matrix of
ASCII numbers, where the numbers are separated
by spaces, tabs, end-of-lines, carriage returns, or
commas. You will be asked for the X,Y, and Z
dimension sizes.
Binary Matrix You can read datasets containing a 3D Matrix of
binary numbers, where the numbers are in 8-bit, 16-
bit, or 32-bit integer format (signed or unsigned),
or in 32-bit or 64-bit IEEE floating point format.
VMS F-Float and 24-bit image formats are also
supported. You will be asked for the number of
header bytes, the X, Y, and Z dimension sizes, the
number type, whether the data is row-major or
column-major order, and whether to swap bytes.

2.2 Specifying the Input File/Folder and File


Type
2.2.1 Select Input File or Folder
Click Single File… if you have a single 3D Matrix input file, or click Folder…
if you have a series of 3D Matrix input files that you want to convert to a single
4D file. You can choose to show only certain types of files, using the popup in
the file selector dialog as shown below.

Note that sometimes the Macintosh thinks a file is of one type when it is really
of another. For example, binary files that have been transferred to the

8 CHAPTER 2: Converting 3D Matrix Files or Folders of 3D Files


Data Utility User’s Guide

Macintosh using commercial communications programs will often be flagged


as type TEXT when they clearly are not.

2.2.2 Select Input File Type


3D HDF, PICS, and FITS 3D Matrix files are automatically recognized and read
by the Data Utility. If your file is an ASCII Text Matrix file or a Binary Matrix file,
you will however get the following dialog:

Make sure that you have selected Matrix Data from the Format Popup. Also,
make sure that the appropriate radio button, Text File or Binary File, is
selected. After clicking OK, fill out either the Text Matrix dialog or the Binary
Matrix dialog as discussed below.

2.2.3 Select Records in PICS and FITS files


If you select a PICS or a multi-record FITS file, you will be shown a list of
records in the file. Highlight every record that you want to include in the
output file, or click Select All to select all of the records in the PICS or FITS
file.

2.3 Specifying the Input File Format


You need to specify the input file format for Binary and ASCII Text Matrix files.

Specifying the Input File Format 9


Data Utility User’s Guide

2.3.1 Specifying the Input File Format for ASCII Text


Matrix Files
You will see the following dialog if you specify Matrix Data and Text File in
the Input File Format dialog. Here you describe the format of your 3D ASCII
Text Matrix File.

3D matrix Make sure this option is selected if you have a 3D


Matrix file.
Fortner Transform Data Matrix
Does not apply to 3D Matrix files. Make sure it is
not selected.
Header lines The number of text lines to ignore before reading
data. Each header line is assumed to end with a CR,
LF, or both.
Layers (Z) The size (number of elements) of the least varying
dimension of your matrix. The ASCII numbers must
be separated by spaces, commas, tabs, CR, or LF.
Rows (Y) The size of the intermediate dimension of your
matrix.
Columns (X) The size of the most varying dimension of your
matrix.
View File… See an ASCII text printout of the input file.
When done, click OK to continue.

10 CHAPTER 2: Converting 3D Matrix Files or Folders of 3D Files


Data Utility User’s Guide

NOTE: If your file name is of the form: name(100x200x300), where 100,


200, and 300 are the Z,Y, and X dimensions of your matrix, the Data Utility
will enter these values in the dialog for you. See the Data Input chapter in the
Slicer manual for more information.

2.3.2 Specifying the Input File Format for Binary


Matrix Files
You will see the following dialog if you specify Matrix Data and Binary File
in the Input File Format dialog. Here you describe the format of your binary
matrix file.

Number type Specify the format for your binary numbers from
the popup. Supported formats include signed and
unsigned 8-bit, 16-bit, and 32-bit integers, 32-bit
float, 64-bit float, VMS float, and 24-bit image files.
3D matrix Make sure this option is selected if you have a 3D
Matrix file.
Swap bytes Swap most significant with least significant byte.
Needed when importing integer binary data from
Intel (MS-DOS) and VAX computers.
Row major order If selected, then the most varying dimension is the
X-size (columns). This is the default.

Specifying the Input File Format 11


Data Utility User’s Guide

Column major order


If selected, then the most varying dimension is the
Z-size (layers), the least varying is the X-size.
Skip bytes Number of bytes to skip before reading the data.
Layers (Z) The size (number of elements) of the least varying
dimension of your matrix (most varying if Column
major is selected).
Rows (Y) The size of the intermediate dimension of your
matrix.
Columns (X) The size of the most varying dimension of your
matrix (least varying if Column major selected).
View File… See a binary (Hex) and text printout of the file.
When done click OK to continue.
NOTE: The Column major radio button is redundant. You can accomplish the
same thing by clicking Column major and just entering the sizes of your
matrix dimensions in reverse order (most varying first). The Row/Column
major radio buttons are just a convenience.

12 CHAPTER 2: Converting 3D Matrix Files or Folders of 3D Files


Data Utility User’s Guide

2.4 Specifying the Output File Format and


Name
After specifying the input file (or folder) type and format, you then choose
how to write the 3D or 4D output file.

Input Summary Describes your input file or folder, giving the file
type, the number type, and the 3D dimensions of
your input file or files.
Output File: Dimensions
The size of the output file. For 3D files this size is
identical to the input file size. When creating 4D
files from a series of 3D files, this size will show the
four dimensions.
Output File: Number Type
You can choose whether to keep the output
number type identical to the input number type,
convert to byte values, or convert to 32-bit IEEE
floating point values.
Click Proceed to continue and specify the output file name (except when
converting to byte, see below).

Specifying the Output File Format and Name 13


Data Utility User’s Guide

2.4.1 Converting Output to Bytes


If you have chosen to convert the output to byte values, you will be presented
with the dialog described below.

You have to choose whether to Limit or Rescale your input data values when
writing to an output byte file.
Limit Input data values between 0 and 255 will convert
directly to the byte output file. Input data values
below 0 will all map to 0. Input data values above
255 will all map to 255.
Rescale Input data values will be scaled to fit within the
range of 1 to 254. The minimum input data value
(displayed in the dialog) will be mapped to 1, the
maximum data value to 254, and intermediate
input values to the properly scaled output values.
The data minimum and maximum values are
calculated for you. However, you can enter your
own values for the input data minimum and
maximum.
Input data values that are below the minimum specified will map to an output
value of 1, and input data values above the maximum will map to an output
value of 254.
Click OK to continue and specify the output file name.

14 CHAPTER 2: Converting 3D Matrix Files or Folders of 3D Files


Data Utility User’s Guide

2.4.2 Specifying Output File Name


Enter the name of your Slicer-compatible 3D or 4D output file in the dialog
shown below. If you are reading a folder of files, make sure that your output
file is NOT written to the input file folder.

Click Save to continue. You will eventually see a message saying that the file
was written correctly, unless you are writing out a 4D floating point dataset, in
which case you will see the dialog shown below.

Specifying the Output File Format and Name 15


Data Utility User’s Guide

16 CHAPTER 2: Converting 3D Matrix Files or Folders of 3D Files


CHAPTER 3 Converting Folders of 2D
Matrix Files

You can convert a folder of 2D matrix files into a Slicer-compatible 3D dataset.


You need to do the following steps to convert your data:
• Specify your input folder and file type (many file types are recognized
automatically).
• Specify the input file format (for ASCII Text Matrix and Binary Matrix files
only).
• Specify the output file format (byte, float) and name.
Each step is discussed in detail below.

3.0.1 Supported 2D Matrix File Types


The following 2D Matrix file types are supported:
2D HDF The data utility reads HDF 2D scientific datasets in
byte, integer, or floating point format, and 8-bit
and 24-bit raster image datasets. If the HDF file
contains more than one record, you will be asked
which record to use.
PICT The utility reads Macintosh PICT graphic files. Each
graphic file is converted to a raster image during
the conversion.

Specifying the Output File Format and Name 17


Data Utility User’s Guide

TIFF (Tagged Image File Format)


The utility supports 4-bit, 8-bit, and 24-bit TIFF
images in uncompressed format.
FITS (Flexible Image Transport System)
The data utility supports 2D 8-bit unsigned, and 16-
bit and 32-bit signed integer datafiles, as well as
single- and double-precision floating point datafiles.
GIF (Graphics Interchange Format)
The data utility supports the ‘87a’ and ‘89a’
standards for GIF files.
XWD (X Window Dump)
The utility supports XYBitmap and ZPixmap files of
any bit depth.
PBM (Portable Bit Map)
The utility supports ASCII Text and binary PBM,
PNM, PGM, and PPM files. ASCII Text PBM files
should not contain values larger than 255.
MATLAB The utility supports 2D MatLab data records of all
number types.
ASCII Matrix You can read a 2D Matrix of ASCII Text numbers, in
which the numbers are separated by spaces, tabs,
end-of-lines, carriage returns, or commas. You will
be asked for the X and Y dimension sizes.
Binary Matrix You can read a 2D Matrix of binary numbers, in
which the numbers are in 8-bit, 16-bit, or 32-bit
integer format (signed or unsigned), or in 32-bit or
64-bit IEEE floating point format. VMS F-Float and
24-bit image formats are also supported. You will
be asked for the number of header bytes, the
dimension sizes, the number type, whether the
data is row-major or column-major order, and
whether to swap bytes.

18 CHAPTER 3: Converting Folders of 2D Matrix Files


Data Utility User’s Guide

3.1 Specifying the Input Folder and File Type


3.1.1 Select Input File or Folder:
Click Folder… You can choose to show only certain types of files, using the
popup in the file selector dialog. Note that sometimes the Macintosh thinks
that a file is of one type when it is really of another. For example, binary files
that have been transferred to the Macintosh using commercial
communications programs will often be flagged as type TEXT when they
clearly are not.

3.1.2 Select Input File Type:


2D HDF, PICT, TIFF, FITS, PBM, and GIF files are automatically recognized and
read by the Data Utility. If your file is a MATLAB file, an X Window dump, an
ASCII Text Matrix file, or a Binary Matrix file, you will instead see the dialog
shown here. Follow the directions listed for your file type as discussed below.

Text Matrix or Binary Matrix


Make sure that the appropriate radio button, Text
Matrix or Binary Matrix, is selected.
Text Columns or Binary Columns
Make sure that the appropriate radio button, Text
Columns or Binary Columns, is selected.

Specifying the Input Folder and File Type 19


Data Utility User’s Guide

MATLAB or X Window Dump


Select MATLAB or X Window Dump. Click OK to
specify the output file format.
PLOT3D Grid File A PLOT3D dataset consists of at least two files: a
“Grid” file containing the computational mesh, and
a series of datafiles using that grid file, here called
“Q” files. The file that you have just selected must
be a “Grid” file (you will be prompted for the
datafiles later).
Transform ASCII Special
This format is used by Transform. See the Transform
manual for more information on this format. After
selecting ASCII Special, make sure you select Text
Matrix, since ASCII Special is a text only format.
For ASCII Special files, the only item in the Text
Matrix file dialog that is useful is the number of
Header lines.

3.2 Specifying the Input File Format


You need to specify the input file format for Binary and ASCII Text Matrix files.

20 CHAPTER 3: Converting Folders of 2D Matrix Files


Data Utility User’s Guide

3.2.1 Specifying the Input File Format for ASCII Text


Matrix Files
You will see the following dialog if you specify Matrix Data and Text File in
the Input File Format dialog. Here you describe the format of your 2D ASCII
Text Matrix File.

3D matrix Make sure this option is NOT selected for 2D matrix


files.
Fortner Transform Data Matrix
Click if the data was written out as ASCII Text by
Transform. In this format, the first row of numbers
are the column labels, the first column the row
labels, and the other positions the data values. See
the Transform manual for more information on this
format.
Header lines The number of text lines to ignore before reading
data. Each header line is assumed to end with a CR,
LF, or both.
Estimate Sizes Click to estimate the row and column sizes by
assuming that each row ends in an end-of-line (CR
and/or LF). Note that if rows do not end in a CR or
LF, you can still read in the data, but you must
enter the row/column sizes yourself.

Specifying the Input File Format 21


Data Utility User’s Guide

Rows (Y) The size (number of elements) of the least varying


dimension of your matrix. The ASCII numbers must
be separated by spaces, commas, tabs, CR, or LF.
Columns (X) The size of the most varying dimension of your
matrix.
View File… See an ASCII text printout of the input file.
When done, click OK to continue.
NOTE: If your file name is of the form: name(200x300), where 200 and 300
are the Y and X dimensions of your matrix, the Data Utility will enter these
values in the dialog for you. See the Data Input chapter in the Slicer manual
for more information.

3.2.2 Specifying the Input File Format for Binary


Matrix Files
You will see the following dialog if you specify Matrix Data and Binary File
in the Input File Format dialog. Here you describe the format of your binary
matrix file.

Number type Specify the format for your binary numbers from
the popup. Supported formats include signed and
unsigned 8-bit, 16-bit, and 32-bit integers, 32-bit
float, 64-bit float, VMS float, and 24-bit image files.

22 CHAPTER 3: Converting Folders of 2D Matrix Files


Data Utility User’s Guide

3D matrix Make sure this option is NOT selected for 2D Matrix


files.
Swap bytes Swap most significant with least significant byte.
Needed when importing integer binary data from
Intel (MS-DOS) and VAX computers.
Row major order If selected, then the most varying dimension is the
X-size (columns). This is the default.
Column major order
If selected, then the most varying dimension is the
Y-size (rows), the least varying is the X-size.
Skip bytes Number of bytes to skip before reading data.
Rows (Y) The size of the least varying dimension of your
matrix (most varying if Column major selected).
Columns (X) The size of the most varying dimension of your
matrix (least varying if Column major selected).
View File… See a binary (Hex) and text printout of the file.
When done click OK to continue.
NOTE: The Column major radio button is redundant. You can accomplish the
same thing by clicking Column major and just entering the sizes of your
matrix dimensions in reverse order (most varying first). The Row/Column
major radio buttons are just a convenience.

Specifying the Input File Format 23


Data Utility User’s Guide

3.2.3 Specifying the Output File Format and Name


After specifying the input file (or folder) type and format, you then choose
how to write the 3D output file.

Input Summary:Domain
Describes your input folder, giving the domain of
your input files.
Input Summary:File type
Describes your input file, giving the file type of your
input files.
Input Summary:Number type
Describes your input file, giving the number type of
your input files.
Input Summary:Dimensions
Describes your input file, giving the dimensions of
your input files.
Output File: Dimensions
The size of the output file, equal to the 2D Matrix
size times the number of files.

24 CHAPTER 3: Converting Folders of 2D Matrix Files


Data Utility User’s Guide

Output File: Number Type


You can choose whether to keep the output
number type identical to the input number type,
convert to byte values, or convert to 32-bit IEEE
floating point values.
Click Proceed to continue. If you are converting to byte values, you will be
presented with the dialog shown below. Otherwise, you will be prompted for
the output file name.

3.2.4 Converting Output to Bytes


If you have chosen to convert the output to byte values, you will be presented
with the dialog described below.

You have to choose whether to Limit or Rescale your input data values when
writing to an output byte file.
Limit Input data values between 0 and 255 will convert
directly to the byte output file. Input data values
below 0 will all map to 0. Input data values above
255 will all map to 255.
Rescale Input data values will be scaled to fit within the
range of 1 to 254. The minimum input data value
(displayed in the dialog) will be mapped to 1, the
maximum data value to 254, and intermediate

Specifying the Input File Format 25


Data Utility User’s Guide

input values to the properly scaled output values.


The data minimum and maximum values are
calculated for you. However, you can enter your
own values for the input data minimum and
maximum.
Input data values that are below the minimum specified will map to an output
value of 1, and input data values above the maximum will map to an output
value of 254.
Click OK to continue and specify the output file name.

3.2.5 Specifying Output File Name


Enter the name of your Slicer-compatible 3D output file in the dialog shown
below. Make sure that your output file is NOT written to the input file folder.

Click Save to continue. If your output datafile is a byte file, you will then see a
message saying that the file was written correctly. If your output datafile is a
floating point file, you will next see the dialog shown below.

26 CHAPTER 3: Converting Folders of 2D Matrix Files


CHAPTER 4 Converting
Column Files

You can convert a single column file into a Slicer-compatible 3D dataset The
input column file must contain columns for the X, Y, and Z dimensions, in
addition to a column for the data. You need to do the following steps to
convert your data:
• Specify your input file and file type
• Specify your input file format
• Specify the X, Y, Z, and data columns
• Specify the size and dimensions of the target matrix
• Specify the target matrix filling method
• Specify the output file format (byte, float) and name.
Each step is discussed in detail below.

4.0.1 Supported Column File Types


The following column file types are supported:
ASCII Column You can read columns of ASCII numbers
representing X, Y, Z, and data values, where the
numbers are separated by spaces, commas, tabs, or
some combination of the three. Typically any
number of delimiters separate each column,
although optionally each delimiter character can
specify a new column. The columns can also be in

Specifying the Input File Format 27


Data Utility User’s Guide

‘fixed’ format, where the starting and ending


character position for each column is specified
explicitly. You will be asked for the number of
header lines, the number of columns, the number
of rows, and which columns represent dimensions
and which represent data.
Binary Column You can read columns of binary numbers
representing the X, Y, Z and data values, where the
numbers are in 8-bit, 16-bit, or 32-bit integer
format (signed or unsigned), or in 32-bit or 64-bit
IEEE or VMS F-Float floating point formats. You will
be asked for the number of header bytes, the
number of columns, the number of rows, and
which columns represent dimensions and which
represent data.
PLOT3D PLOT3D datafiles are treated as column files in the
data utility. Both binary and ASCII file formats are
supported, organized as either 3D/whole or 3D/
planes files. You can also have multiple Q files for
each Grid file.
HDF VSET HDF files containing floating-point VSET records are
supported. A VSET record contains a series of linked
columns of numbers.

4.1 Specifying the Input File and File Type


4.1.1 Select Input File or Folder:
Click Single File… to read your Column file.

4.1.2 Select Input File Type:


HDF VSET files are automatically recognized and read by the Data Utility. If you
are importing a PLOT3D file, an ASCII Text Column file or a Binary Column file,
you will see the Input File Format dialog. Follow the directions for the
column file type as described below.

28 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

Text Matrix or Binary Matrix


Make sure that the appropriate radio button, Text
Matrix or Binary Matrix, is selected.
Text Columns or Binary Columns
Make sure that the appropriate radio button, Text
Columns or Binary Columns, is selected.
MATLAB or X Window Dump
Select MATLAB or X Window Dump. Click OK to
specify the output file format.
PLOT3D Grid File A PLOT3D dataset consists of at least two files: a
“Grid” file containing the computational mesh, and
a series of datafiles using that grid file, here called
“Q” files. The file that you have just selected must
be a “Grid” file (you will be prompted for the
datafiles later).
Transform ASCII Special
This format is used by Transform. See the Transform
manual for more information on this format. After
selecting ASCII Special, make sure you select Text
Matrix, since ASCII Special is a text only format.
For ASCII Special files, the only item in the Text
Matrix file dialog that is useful is the number of
Header lines.

Specifying the Input File and File Type 29


Data Utility User’s Guide

4.2 Specifying the Input File Format


You need to specify the input file format for ASCII Text Column files, Binary
Column files, and PLOT3D files.

4.2.1 Specifying the Input File Format for ASCII Text


Column Files
You will see the following dialog if you specify Column Data and Text File in
the Input File Format dialog. Here you describe the format of your 3D ASCII
Text Column File.

Delimiters Here you specify how the ASCII columns are


separated: by Tabs, Spaces, or Commas, or various
combinations. The Fixed Fields options is described
in more detail below.

30 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

Separate column for each delimiter


Normally, columns are separated by any number of
delimiters. If however this option is selected, then
the Data Utility assumes that there is only one
delimiter between each column. In this case, two
delimiters (two commas, say) would specify a
column position that does not have a value.
Last header line contains column titles
If selected, then the last line before the actual data
is assumed to contain titles for each column. Each
column title must be separated by the delimiter or
delimiters specified by the Delimiters popup.
Header lines The number of text lines to ignore before reading
data. Each header line is assumed to end with a CR,
LF, or both.
Estimate Sizes When clicked, the Data Utility scans the input file
and makes an intelligent guess on the number of
header lines, rows, and columns.
Number of rows The number of lines of data. Each data line is
assumed to end with a CR, LF, or both.
Number of columns
The number of columns of data. Each column must
be separated by the delimiters you specify in the
Delimiters popup.
View File… See an ASCII Text printout of the input file.
When done, click OK to continue.

4.2.2 Fixed Fields Delimiters


If your columns are not separated by delimiter characters but are instead
printed out with fixed column positions, you may wish to use the Fixed Fields
format. When Fixed Fields is selected on the Delimiters popup, the View
File… button changes to Set Columns…. Click Set Columns… to select
your fixed field columns.

Specifying the Input File Format 31


Data Utility User’s Guide

Click and drag across each column that you wish to import. You will need to
select columns for the X, Y, and Z axes, and for the data values. You can also
specify each column numerically. Each column is specified by a starting
character number, followed by a colon (:), followed by the ending character
number. Column specifications are separated by commas (,).

4.2.3 Specifying the Input File Format for Binary


Column Files
You will see the following dialog if you specify Column Data and Binary File
in the Input File Format dialog. Here you describe the format of your binary
column file. The Data Utility assumes the data consists of a stream of binary
numbers: that there are no separators between either the rows or the
columns.

32 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

Number type Specify the format for your binary numbers from
the popup. Supported formats include signed and
unsigned 8-bit, 16-bit, and 32-bit integers, 32-bit
float, 64-bit float, VMS float, and 24-bit image files.
Swap bytes Swap most significant with least significant byte.
Needed when importing integer binary data from
Intel (MS-DOS) and VAX computers.
Skip bytes Number of bytes to skip before reading the data.
Number of rows The number of lines of data.
Number of column
s
The number of columns of data.
View File… See a binary (Hex) and text printout of the file.
When done click OK to continue.

4.2.4 Specifying the Input File Format for PLOT3D


Files
You will see the following dialog if you specify PLOT3D Grid file in the Input
File Format dialog. Here you specify the dimensions of the Grid file and
associated datafiles, and specify the datafiles (Q Files) for the Grid file.

Specifying the Input File Format 33


Data Utility User’s Guide

Data dimensions Specify whether your Grid file and Q files are 2D
files, or 3D files, organized as a volume (/whole) or
as a series of planes (/planes).
View Grid File… See a binary (Hex) and text printout of your Grid
file. Because of memory limitations, this option is
not available after you have specified any “Q” files.
Add Q File… Use this option to select the datafiles, or “Q” files,
associated with your Grid file. You can read any
number of Q files that use the same Grid file. The
current Grid file, the last Q file that you specified,
and the number of Q files specified are all reported
in the lower left of the dialog.
When done click Done to continue.
NOTE: Since Slicer only works with uniform grid files, part of the Data Utility
conversion process is interpolating PLOT3D datapoints onto a uniform grid.
The resulting output file is adequate for most visualization purposes.

34 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

4.3 Specifying the Columns


After specifying the input file type and format, you now need to specify which
columns to use for coordinates and data.

4.3.1 Coordinates Columns:


Here you specify which columns to use for the X, Y, and Z coordinates. Type
the column number for each coordinate, or use the arrows to cycle through
the possible columns.
The column numbers and names are listed on the right. The default names for
the columns are 'Column 1', 'Column 2', etc. If however you had previously
specified that the last header line contained column titles, then those titles are
displayed here.
A '0' for a coordinate means that you are not specifying any value for that
coordinate, None will be displayed in the column number box. You may want
to do this if you are using a series of data columns as a third dimension, as
described below on specifying multiple data columns.

Specifying the Columns 35


Data Utility User’s Guide

4.3.2 Data Column(s):


Here you select the column to be treated as the data column. You can select
NO data column, one data column (the default), or multiple data columns. By
far the most common option is to select one data column.
No Data Column To specify NO data column, click None in the
columns list. This makes it possible to construct a
data volume where each element contains a count
of the number of input datapoints (X,Y, Z points)
that fall within that element. To do this you must
also select Place data only as your Matrix fill
method, and specify Sum Values as the Data
Placement option (see below).
One Data Column This is the most common case. To specify a single
data column, just click the column in the list. Note
that you cannot select a column already being used
as a coordinate column.
Multiple Data columns
To select multiple columns, hold down the shift key
as you select each data column. When multiple
columns are selected, the column number is treated
as a coordinate variable (usually the Z coordinate).
This in essence lets you treat each data column as a
separate 2D 'layer' in a 3D dataset. You must make
sure that at least one of your coordinate columns is
set to None to output a 3D dataset.
For example, suppose you have a 22 column file. You set columns 1 and 2 to
the X and Y coordinate columns respectively, the Z coordinate column to
None, and set columns 3 through 22 to be data columns. In this example, all
of the data from column 3 will be placed in a Z=1 layer, the data from column
4 will be placed in a Z=2 layer, and so on, all the way up to column 22, which
is placed in a Z=20 layer.
NOTE: If you do specify all three coordinate columns, along with multiple data
columns, then the output file will be a 4D dataset.
You must next specify your Target Matrix and your Matrix fill method,
described below, before clicking OK.

36 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

4.4 Specifying the Target Matrix


To specify the size of the output file, click Target Matrix. You will be
presented with the dialog shown below.

4.4.1 Coordinates Parameters:


You can specify four parameters for each dimension of your output matrix. The
column name for each coordinate column is listed above the parameters.
Actual Minimum/Maximum
The Data Utility scans each coordinate column and
displays the minimum and maximum values found
in the input dataset.
Minimum You can change the coordinate minimum for the
output matrix to any value. If you choose a value
that is greater than the actual minimum, data
values with coordinates less than your chosen value
will be ignored.

Specifying the Target Matrix 37


Data Utility User’s Guide

Maximum You can change the coordinate maximum for the


output matrix to any value. If you choose a value
that is less than the actual maximum, data values
with coordinates greater than your chosen value
will be ignored.
Increment You can specify the spacing in coordinate units
between each grid element in the target array. Note
that 'Increment' times '# of Points' always equals
the absolute value of 'Maximum' minus 'Minimum'.
# of Points You can specify number of points, or the grid size,
for each coordinate in the target array. Note that
'Increment' times '# of Points' always equals the
absolute value of 'Maximum' minus 'Minimum'.
Rounded Scales Click this button to have the Data Utility round the
coordinate minimum, maximum, and increment
values. This will change the '# of Points' values. You
can modify these new numbers if you wish.
Note that the button changes to Actual Scales after you click it. Clicking on
this button will restore the actual minimum, maximum, and increment values.

4.4.2 Data Parameters:


You can scroll through all of the data columns by clicking on the up/down
arrows next to the 'Data from' box. The corresponding data titles are displayed
next to the data column numbers. Here you can specify the legal range of data
values.
Actual The Data Utility scans the displayed data column
and displays the minimum and maximum values
found in the input dataset for that column.
Data Minimum/Maximum
You can specify a range of values that is smaller
than the actual data range. Data values that are
outside the range you specified are ignored.
For example, suppose your data column was 'Temperature'. Most of the data
values were in the range -15 to 76, but some values were set to -99. which
meant that the location did not have a temperature value.

38 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

The Data Utility would therefore display -99 to 76 as the temperature data
range. To create a valid output matrix, you would have to specify a data range
of -15 to 76, so that all of the -99 data values would be ignored.
When done, click OK to return to the main column dialog.

4.5 Specifying the Matrix Fill Method


Typically there are many fewer input data values than output matrix data
values. The rest of the output matrix has to be interpolated from the input
data values. Select one of the three methods under Matrix fill method. Each
method is described below.

4.5.1 Place Data Only


The input data values are ‘bin’ed to their corresponding data locations in the
output matrix. All other output matrix data locations are set to a 'missing data'
value that is below any valid input data value. You can change this 'missing
data' value after clicking Proceed in the main column dialog, as shown below.

4.5.2 Data Placement


In Place Data it is possible for two input data values to ‘bin’ to the same data
location in the output matrix. You can choose what happens in this case by
clicking the Data Placement button.

In the dialog above you can choose to use just the last value encountered, to
sum all values that bin to each location, or to average all values that bin to the
same location. Click OK to return to the main column dialog.

Specifying the Matrix Fill Method 39


Data Utility User’s Guide

4.5.3 Missing Data Value


If you specify Place Data Only as your matrix fill method, you will see the dialog
shown below after clicking Proceed in the main column dialog.

The Data Utility defaults to a missing data value that is outside the scanned
data range. You can change this missing data value to anything that you wish.

4.5.4 Simple Fill


If selected, the output matrix data locations that are not set by the input data
values are interpolated from the nearest input data values, using a 3 by 3
smoothing kernel. This method produces a smooth 3D matrix, but does not
preserve the input data values. If you have a few hundred or more input
datapoints, Simple Fill is a good interpolation choice.
As in the Place Data Only option, you need to specify what happens when two
data values bin to the same data location, as detailed in the Data Placement
dialog shown above. Click the Data Placement… button to see this dialog.

4.5.5 Kriging
If selected, the output matrix data locations that are not set by the input data
values are interpolated from the nearest input data values, using the Kriging
method.

40 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

By some measures, Kriging produces the best possible interpolation of


unknown values from known values. Kriging also preserves known data values.
However, the routine is very computationally intensive, taking minutes to
hours to execute (depending on your data size and your computer). This
routine is probably not practical for more than 1000 input datapoints.
Click the Kriging Settings… button to change the various Kriging
Parameters. The Data Utility selects the best guess for all of the Kriging
parameters, although you may change them if you wish.

Spatial distribution model


Specify whether the influence of each data value
falls off as a Linear, Spherical, Exponential, or
Gaussian function.
Normalize coordinates
Select this option if your X, Y, and Z scales have
very different ranges.
Range Specify the range of influence of each data value, in
coordinate units.
Variance Specify the variance assigned to the input data
values (a variance of 1.0 here means no uncertainty
in the input data values).
Nugget A step increase in the variance right at known
datapoints. The default value is 0.

Specifying the Matrix Fill Method 41


Data Utility User’s Guide

Desired sample size per kriging pass


The Data Utility interpolates the data one sub-
volume at a time. The program makes sure that
each sub-volume has fewer than the number of
data values specified here. This sub-dividing of the
volume greatly speeds up the Kriging process.
Smaller numbers here can improve performance, at
some risk of producing artifacts at the sub-volume
boundaries.
Construct variance matrix
If selected, the Data Utility will create a second file
named 'output.var', where 'output' is the name of
your output file, which contains the variance values
for your output matrix.
Display kriging statistics
If selected, you will see the following dialog after
writing out your output matrix.

4.6 Specifying the Output File Format and


Name
After you specify the input file type and format, you will see the following
dialog allowing you to choose how to write the 3D or 4D output file.

42 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

Input Summary Describes your input column file, giving the file
name, number of selected data columns, and
whether it is a Text or Binary file.
Output File: Dimensions
The size of the output file, which you specified in
the Target Matrix dialog.
Output File: Number Type
You can choose whether to keep the output
number type identical to the input number type,
convert to byte values, or convert to 32-bit IEEE
floating point values. For column datasets, the
'input' number type is always assumed to be
floating point.
Click Proceed to continue. If you have chosen to convert to byte files, you will
see the dialog shown below. Otherwise, you will be asked for an output file
name.

Specifying the Output File Format and Name 43


Data Utility User’s Guide

4.6.1 Converting Output to Bytes


If you have chosen to convert the output to byte values, you will be presented
with the dialog described below.

You have to choose whether to Limit or Rescale your input data values when
writing to an output byte file.
Limit Input data values of between 0 and 255 will
convert directly to the byte output file. Input data
values below 0 will all map to 0. Input data values
above 255 will all map to 255.
Rescale Input data values will be scaled to fit within the
range of 1 to 254. The minimum input data value
(displayed in the dialog) will be mapped to 1, the
maximum data value to 254, and intermediate
input values to the properly scaled output values.
The data minimum and maximum values are
calculated for you. However, you can enter your
own values for the input data minimum and
maximum.
Input data values that are below the minimum specified will map to an output
value of 1, and input data values above the maximum will map to an output
value of 254.
Click OK to continue and specify the output file name.

44 CHAPTER 4: Converting Column Files


Data Utility User’s Guide

4.6.2 Specifying Output File Name


Enter the name of your Slicer-compatible 3D output file in the dialog shown
below.

Click Save to continue. You should see a message saying that the file was
written correctly after the Data Utility has processed the file.

Specifying the Output File Format and Name 45

You might also like