[Mristudio-users] question about structure of Fiber.dat file
Deepa Krishnaswamy
deepa.krishnaswamy1 at gmail.com
Mon Mar 4 21:22:00 EST 2013
Hi,
Sorry about the incomplete e-mail.
For part A in question 'How is the fiber stored', the header information is
given as:
- int *nFiberLength*; // fiber length
- unsigned char *cReserved*;
- RGB_TRIPLE *rgbFiberColor*; // R-G-B, 3 bytes totally
- int *nSelectFiberStartPoint*;
- int *nSelectFiberEndPoint*;
- XYZ_TRIPLE *xyzFiberCoordinate*[nFiberLength]; //x-y-z, 3 float data
and then next fiber data..
For part A in question 'How do you read in individual fiber coordinates
outside the DTI Studio Environment':
- // move file pointer 128, where fiber-data starts;
- fileIn.Seek(128,CFile::begin);
- int nAryIdx = 0;
for (i=0; i<stFiberFileHeader.nFiberNr; i++) {
-
fileIn.Read(&m_stAryFiber[nAryIdx].*nLength*, sizeof(int)); // read
length
-
fileIn.Read(&m_stAryFiber[nAryIdx].*nSelStatus*, sizeof(BYTE)); //
read sel-status
-
fileIn.Read(&m_stAryFiber[nAryIdx].*rgbColor*, sizeof(RGB_TRIPLE));
// read color
-
fileIn.Read(&m_stAryFiber[nAryIdx].*nSelLenStart*, sizeof(int)); //
read fiber-sel-start
-
fileIn.Read(&m_stAryFiber[nAryIdx].*nSelLenEnd*, sizeof(int)); //
read fiber-sel-end
-
if (m_nFiberFileVersion >= 2005) // new version
-
fileIn.Read(&m_stAryFiber[nAryIdx].xyzPtROI,
sizeof(XYZ_TRIPLE));// read ROI point
// read fiber-chain data
- m_stAryFiber[nAryIdx].*pxyzChain* = new
XYZ_TRIPLE[m_stAryFiber[nAryIdx].nLength];
- fileIn.Read(m_stAryFiber[nAryIdx].pxyzChain,
sizeof(XYZ_TRIPLE)*m_stAryFiber[nAryIdx].nLength); // if slicing
sequencing
is in negative, adjusting z-component before saving the data if
(stFiberFileHeader.enumSliceSequencing == NEGATIVE_Seq) {
-
for (int j=0; j<m_stAryFiber[nAryIdx].nLength; j++)
- m_stAryFiber[nAryIdx].pxyzChain[j].z =
(stFiberFileHeader.nImgSlices-1) -
m_stAryFiber[nAryIdx].pxyzChain[j].z;
} nAryIdx ++;
} fileIn.Close();
As you can see, there are slight differences in the names given. Could
someone please tell me which is correct? I am trying to convert from a .trk
file to a .dat file (I am able to read in the information from the dat file
correctly, but cannot write out the track info without this knowledge).
Thank you,
Deepa
On Mon, Mar 4, 2013 at 9:17 PM, Deepa Krishnaswamy <
deepa.krishnaswamy1 at gmail.com> wrote:
> Hi,
> On the FAQ page about the structure of a fiber.dat file, I believe that
> there is conflicting information about the fields in the struct header.
> For part A in
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mristudio.org/pipermail/mristudio-users/attachments/20130304/e8021c06/attachment-0001.html
More information about the mristudio-users
mailing list