Maverick/View Virtual Family Together: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
Line 6: Line 6:
  VirtualFamilyTxtToMhdCsv Ella_26y_v2_2mm.txt Ella_26y_v2_2mm.raw Ella.mhd Ella.csv
  VirtualFamilyTxtToMhdCsv Ella_26y_v2_2mm.txt Ella_26y_v2_2mm.raw Ella.mhd Ella.csv


This produces representations in the .mhd format.  The current release of Maverick, however, requires the images to be in the .mha format.  So, perform the conversion using imageMath
This produces representations in the .mhd format.   
 
One wacky thing, the man is imaged head-first while the woman is imaged feet-first.  This can be made consistent by adding orientation information to the woman's header file.
 
vi Ella.mhd
 
Add the line before the last line of the file.
 
Orientation = 1 0 0 0 1 0 0 0 -1
 
The final -1 causes the z-axis to be flipped.  The new Ella.mhd should look like this:
 
NDims = 3
DimSize = 265 150 840
HeaderSize = -1
ElementType = MET_UCHAR
ElementByteOrderMSB = True
ElementSpacing = 2 2 2
Orientation = 1 0 0 0 1 0 0 0 -1
ElementDataFile = Ella_26y_V2_2mm.raw
 
The current release of Maverick, however, requires the images to be in the .mha format.  So, perform the conversion using imageMath


  imageMath Duke.mhd -W 3 Duke.mha
  imageMath Duke.mhd -W 3 Duke.mha

Revision as of 03:37, 7 October 2008

Create a scene using the virtual family

First convert two members of the virtual family

VirtualFamilyTxtToMhdCsv Duke_34y_v5_2mm.txt Duke_34y_v5_2mm.raw Duke.mhd Duke.csv
VirtualFamilyTxtToMhdCsv Ella_26y_v2_2mm.txt Ella_26y_v2_2mm.raw Ella.mhd Ella.csv

This produces representations in the .mhd format.

One wacky thing, the man is imaged head-first while the woman is imaged feet-first. This can be made consistent by adding orientation information to the woman's header file.

vi Ella.mhd

Add the line before the last line of the file.

Orientation = 1 0 0 0 1 0 0 0 -1

The final -1 causes the z-axis to be flipped. The new Ella.mhd should look like this:

NDims = 3
DimSize = 265 150 840
HeaderSize = -1
ElementType = MET_UCHAR
ElementByteOrderMSB = True
ElementSpacing = 2 2 2
Orientation = 1 0 0 0 1 0 0 0 -1
ElementDataFile = Ella_26y_V2_2mm.raw

The current release of Maverick, however, requires the images to be in the .mha format. So, perform the conversion using imageMath

imageMath Duke.mhd -W 3 Duke.mha
imageMath Ella.mhd -W 3 Ella.mha

Now Merlin can be used to create a scene containing these labelmaps and indexed via those .csv files. Use the standard labelmap import process of Merlin to achieve this.

Create a new version of the woman that is as tall as the man

To simulate different size people, the virtual woman (Ella) can be registered with the virtual man (Duke). The RegisterImages module accomplishes this

RegisterImages Duke.mha Ella.mha 
   --registration PipelineAffine --interpolation NearestNeighbor 
   --resampledImage TallElla.mha --saveTransform TallElla.tfm

All of the above should be on one line.

Processing time will vary from 5 minutes to 30 minutes, depending on the PC.

The result should be two new files: TallElla.mha and TallElla.tfm

The TallElla.mha file can be imported into Merlin.

The TallElla.tfm file defines an Affine transform consisting of a matrix and an offset. The file should look something like this:

#Insight Transform File V1.0
# Transform 0
Transform: AffineTransform_double_3_3
Parameters: 0.870992 -0.0224575 -0.0878403 
            0.0659526 0.83837 -0.050303 
            0.0122104 -0.0274275 0.726458  
            -46.4034 -4.29241 -148.693
FixedParameters: 264 150 840

View the short and tall ella next to one another in the same volume

First move TellElla 500 mm to the right by editing the file TallElla.mha using vi or another text editor.

vi TallElla.mha

Change line containing the keyword Offset to induce the shift

Offset =