Class CreateSignalDataSet
- java.lang.Object
-
- edu.rit.mri.CreateSignalDataSet
-
public class CreateSignalDataSet extends java.lang.ObjectClass CreateSignalDataSet is a preprocessing program that reads a magnetic resonance image stored in a group of files in a certain format and creates a spin signal data set file. This spin signal data set file is then used by the other programs in package edu.rit.mri.Usage: java edu.rit.mri.CreateSignalDataSet timesfile maskfile signalfile
timesfile = Input times file
maskfile = Input mask file
signalfile = Output spin signal data set fileThe program's error handling is rudimentary. If an error is encountered, the program throws an exception and terminates.
The format of the output spin signal data set file is described in class SignalDataSetWriter. The formats of the input files are described below.
Times file. The times file is a plain text file giving the image dimensions in pixels and the list of discrete time values at which the images were taken. Each line of the times file consists of fields separated by white space. The first line of the times file has two fields, the image height H (integer) and the image width W (integer). The rest of the times file consists of M lines. The first field on each line gives ti, the time (sec, real number) at which measurement i was taken, 0 ≤ i ≤ M−1. The second field on each line gives the name of the data file for measurement i.
Data files. Each data file is a binary file containing the pixel data values for a certain measurement i taken at time ti. The file contains H×W spin signal values Src(ti), where r is the pixel's row in the range 0 ≤ r ≤ H−1 and c is the pixel's column in the range 0 ≤ c ≤ W−1. The pixel data values are stored in row major order -- first the pixels in the topmost row from left to right, then the pixels in the second row from left to right, and so on.
Each pixel data value is stored in binary as a two-byte integer in the range −32768 ≤ Src(ti) ≤ 32767. The first two pixels (S00 and S01) do not contain actual data, but instead are set to the values S00 = 0 and S01 = 1. These are used to determine the byte order or endianness with which the pixel data values are stored. If the first four bytes of the data file are 0, 0, 0, 1, then the pixel data values are stored in big-endian order -- most significant byte first. If the first four bytes of the data file are 0, 0, 1, 0, then the pixel values are stored in little-endian order -- least significant byte first. It is assumed that all data files use the same byte order.
Mask file. The mask file is a binary file containing H×W mask values Mrc. Mrc is 1 if pixel (r,c) has data to be analyzed. Mrc is 0 if pixel (r,c) is not to be analyzed.
Each mask value is stored in binary as a two-byte integer. The first pixel (M00) does not contain actual mask data, but instead is set to the value M00 = 1. This is used to determine the mask values' byte order. If the first two bytes of the mask file are 0, 1, then the mask values are stored in big-endian order. If the first two bytes of the mask file are 1, 0, then the mask values are stored in little-endian order.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG