STDOUT ******

Warp sujbect to Model by HAMMER

Input information: 
	input subject segmented image is ./input_dt.img
	input subject original image is ./input_dt.img
	input Model image is template_dt.img
	diretory where subject image stored: .//
	image size on XYZ dimension: 48 48 24
	iteration number: 50
	iteration number for orientation features: 0
	step ratio: 0.02
	neighborhood search size: (12, 10, 8)
	similarity degree: 0.65
	smoothness factor for deformation field: 0.5
	Times for smoothing deformation fields: 1
	Using FSL Flirt for afine registration





Linear align two images

rigidlyregisterdt.sh  ./input_dt.img .//template_dt.img ./input_dt.img.rig 12 48 48 24 5.0 5.0 5.0 48 48 24 5.0 5.0 5.0 YdtiFA 48 48 24 ./input_dt.img _subj.temp.fa.img 0
FloatFA2Byte _subj.temp.fa.img _subj.temp.fa.img
extractventricle _subj.temp.fa.img _subj.temp.fa.img -x48,48 -b 1
dtiFA 48 48 24 .//template_dt.img _mdl.temp.fa.img 0
FloatFA2Byte _mdl.temp.fa.img _mdl.temp.fa.img
extractventricle _mdl.temp.fa.img _mdl.temp.fa.img -x48,48 -b 1
linearlyregisterbyfsl.sh _subj.temp.fa.img _mdl.temp.fa.img _subj.temp.fa.rig _subj.temp.fa.img 12 5.0 5.0 5.0 5.0 5.0 5.0 48
ImgA=_subj.temp.fa.img
ImgB=_mdl.temp.fa.img
TransformedImgA=_subj.temp.fa.rig
OtherTypeOfImgA=_subj.temp.fa.img
dof=12
Ax=5.0
Ay=5.0
Az=5.0
Bx=5.0
By=5.0
Bz=5.0
ImgSizeXY= 48
cp _subj.temp.fa.img  AAA.img
makeavwheader AAA.hdr -d48,48,24 -r5.0,5.0,5.0 -tCHAR
flirt -in AAA.hdr -ref BBB.hdr -out AtoB.hdr -omat AtoB.mat -bins 256 -cost leastsq -searchrx -10 +10 -searchry -10 +10 -searchrz -10 +10 -dof 12 -interp nearestneighbour
Reference: (5.000000,5.000000,5.000000); float: (5.000000,5.000000,5.000000)
Matrix before transforming to my format:
       0.977        0.027       -0.020       -1.051 
      -0.064        0.903        0.008       15.951 
       0.076       -0.027        0.965       -1.548 
       0.000        0.000        0.000        1.000 
Matrix at my format:
       0.977        0.027       -0.020 
      -0.064        0.903        0.008 
       0.076       -0.027        0.965 
ImgA_SliceNo=23
ImgB_SliceNo=23
Crop _subj.temp.fa.img, then transform _subj.temp.fa.img
cropslices  _subj.temp.fa.img AAA.Croped -c0,23 -v48
 start=0
 end=23
 image_size=48
z_size_Output=24
Write file!
transform3dimg AAA.Croped _subj.temp.fa.rig GlobalTransformation.Affine -I -v48
LinearInterpolation=0   NNmapping4SegmentedImg=0
image size: image_size=48  z_size=24
image reading finished!

       0.977        0.027       -0.020 
      -0.064        0.903        0.008 
       0.076       -0.027        0.965 
center1=(128.000000, 128.000000, 62.000000)
center2=(128.349380, 146.921524, 58.634628)
save image!
Crop _subj.temp.fa.img, then transform _subj.temp.fa.img
 start=0
 end=23
 image_size=48
z_size_Output=24
Write file!
LinearInterpolation=0   NNmapping4SegmentedImg=0
image size: image_size=48  z_size=24
image reading finished!

       0.977        0.027       -0.020 
      -0.064        0.903        0.008 
       0.076       -0.027        0.965 
center1=(128.000000, 128.000000, 62.000000)
center2=(128.349380, 146.921524, 58.634628)
save image!
LnWarpDT ./input_dt.img GlobalTransform.Affine -O ./input_dt.img.rig -X 48 -Z 24 -R 5.0,5.0,5.0
Done rigid transformation


*******************************************************************
Low resoultion:
*******************************************************************
Warping './input_dt.img.rig' in low-resolution
TensorStructRegistration_V2.0 template_dt.img ./input_dt.img.rig -R0.02  -D.// -i50  -r12 -m0.65 -s4 -c0.5 -B -E1 -p0.5,1 -X48 
sizeof(off_t)is 8,File size is 10376
before 0
after 8

*******************************************************************
Mid resoultion:
*******************************************************************
Warping './input_dt.img.rig' in mid-resolution
TensorStructRegistration_V2.0 template_dt.img ./input_dt.img.rig -R0.02  -D.// -i50 -r10 -m0.65 -s2 -c0.5 -B -E1 -p0.5,1 -F -X48 
sizeof(off_t)is 8,File size is 82952
before 0
after 8

*******************************************************************
high resoultion:
*******************************************************************
Warping './input_dt.img.rig' in high-resolution
TensorStructRegistration_V2.0 template_dt.img ./input_dt.img.rig -R0.02  -D.// -i50  -r8 -m0.65 -s1 -c0.5 -B -E1 -p0.5,1 -F -X48 
splitfile DeformationField.float.img NoUse 8 Field.1.img
sizeof(off_t)is 8,File size is 663560
before 0
after 8
transform3dvectorfield Field.1.img Field.1.img.trans GlobalTransformation.Affine -v48
No head in vector field file!
vector field size: image_size=48  z_size=24
Vector fields reading finished!

       0.977        0.027       -0.020 
      -0.064        0.903        0.008 
       0.076       -0.027        0.965 
center1=(128.000000, 128.000000, 62.000000)
center2=(128.349380, 146.921524, 58.634628)
reversedeformationfield Field.1.img.Mdl2Subj Field.1.img.Subj2Mdl -X 48 -z 24 
vector field size: image_size=48  z_size=24
Your required slice number is 24
interval=0.333333 SampleNum=1
z=0
z=1
z=2
z=3
z=4
z=5
z=6
z=7
z=8
z=9
z=10
z=11
z=12
z=13
z=14
z=15
z=16
z=17
z=18
z=19
z=20
z=21
z=22
z=23
hammer2xdr Field.1.img.Mdl2Subj Field.1.img.Mdl2Subj.xdr 48 48 24 
Processing slice 0
Processing slice 1
Processing slice 2
Processing slice 3
Processing slice 4
Processing slice 5
Processing slice 6
Processing slice 7
Processing slice 8
Processing slice 9
Processing slice 10
Processing slice 11
Processing slice 12
Processing slice 13
Processing slice 14
Processing slice 15
Processing slice 16
Processing slice 17
Processing slice 18
Processing slice 19
Processing slice 20
Processing slice 21
Processing slice 22
Processing slice 23
hammer2xdr Field.1.img.Subj2Mdl Field.1.img.Subj2Mdl.xdr 48 48 24 
Processing slice 0
Processing slice 1
Processing slice 2
Processing slice 3
Processing slice 4
Processing slice 5
Processing slice 6
Processing slice 7
Processing slice 8
Processing slice 9
Processing slice 10
Processing slice 11
Processing slice 12
Processing slice 13
Processing slice 14
Processing slice 15
Processing slice 16
Processing slice 17
Processing slice 18
Processing slice 19
Processing slice 20
Processing slice 21
Processing slice 22
Processing slice 23
dtiPD 1 48 48 24 ./input_dt.img Subj.pd1.img 1 1 0 
DTI read
PD computed
Adding offset

Central Original Vector: -0.0565933 -0.363468 0.007552
Central Modified Vector: 23.9434 23.6365 12.0076
PD written
warpDT.V5 ./input_dt.img Field.1.img.Subj2Mdl.xdr Field.1.img.Mdl2Subj.xdr Subj.pd1.img -O Warped.Subj.dt -X 48 -Z 24 -R 5.0,5.0,5.0 -N 0 
DTfile=./input_dt.img
fforwardVF=Field.1.img.Subj2Mdl.xdr
freverseVF=Field.1.img.Mdl2Subj.xdr
PD file=Subj.pd1.img
PD2 file=
Z of warped (destZ)=24
number of CPU to be used=1
outDTfile=Warped.Subj.dt

volume resolution=(5,5,5)

Z flip=0
USE_OPTIMIZED_DT_VOLUME=0
Step 1. loading Diffusion Tensor....

----loadData()

 Got memory for DT volume data

 Address allocated : 0x2b76aad1a010


 Volume size = 1327104; should read = 55296 (tensors), while read =55296
 --- Volume loaded, dimZ = 24

 dt Address allocated : 0x2b76aad1a010
 DT volume valued at 22.0794 %
 ZZ value negative = 10.9682%

Step 2. loading the forward warping vector field.... 
         resolution of the volume not important
--opening file: Field.1.img.Subj2Mdl.xdr
total= 663552

 Got memory for vector volume data



 WarpVolume size = 663552; should read = 55296, while read =55296
VoxMap::loadVolume() <Field.1.img.Subj2Mdl.xdr> dimension=(48,48,24)

Step 3. loading the reverse warping vector field.... 
         resolution of the volume not important
--opening file: Field.1.img.Mdl2Subj.xdr
total= 663552

 Got memory for vector volume data



 WarpVolume size = 663552; should read = 55296, while read =55296
VoxMap::loadVolume() <Field.1.img.Mdl2Subj.xdr> dimension=(48,48,24)

Step 4. loading the Primary Direction (PD) vectors .... 
--opening file: Subj.pd1.img
total= 663552

 Got memory for vector volume data



 WarpVolume size = 663552; should read = 55296, while read =55296
VoxMap::loadVolume() <Subj.pd1.img> dimension=(48,48,24)
 PD2 file not supplied. 

Step 5. create matrix volume mVolume: use SVD; and optimize the original DTI 
mVolume::getSpace(): Memory allocated.
in SaveData(): object = 0x2b76ab3a9010
file <optimized.d1> saved OK
A block contains 24 Z-slice

 CPU #0 working on Z slice No. 0.... 23





   processing  ... Z = 0; k= 0    
   processing  ... Z = 1; k= 2304    
   processing  ... Z = 2; k= 4608    
   processing  ... Z = 3; k= 6912    
   processing  ... Z = 4; k= 9216    
   processing  ... Z = 5; k= 11520    
   processing  ... Z = 6; k= 13824    
   processing  ... Z = 7; k= 16128    
   processing  ... Z = 8; k= 18432    
   processing  ... Z = 9; k= 20736    
   processing  ... Z = 10; k= 23040    
   processing  ... Z = 11; k= 25344    
   processing  ... Z = 12; k= 27648    
   processing  ... Z = 13; k= 29952    
   processing  ... Z = 14; k= 32256    
   processing  ... Z = 15; k= 34560    
   processing  ... Z = 16; k= 36864    
   processing  ... Z = 17; k= 39168    
   processing  ... Z = 18; k= 41472    
   processing  ... Z = 19; k= 43776    
   processing  ... Z = 20; k= 46080    
   processing  ... Z = 21; k= 48384    
   processing  ... Z = 22; k= 50688    
   processing  ... Z = 23; k= 52992    

 ***** Processor (0): I am here !!! *****
 (Processor :0) 16 voxels under constrained with Procrustean Analysis 0.0289352%.



Step 6. warp the (optimized) DT volume from original->atlas

~DTVolume(): dt deleted
 ===DTVolume::reorientTensor()==Begin==

Step 7. Cast DT to grid in Atlas

 nDT memory obtained
   tmpXYZ=(25,25,25)



 --Warping DT Slice -0    ----
 --Warping DT Slice -1    ----
 --Warping DT Slice -2    ----
 --Warping DT Slice -3    ----
 --Warping DT Slice -4    ----
 --Warping DT Slice -5    ----
 --Warping DT Slice -6    ----
 --Warping DT Slice -7    ----
 --Warping DT Slice -8    ----
 --Warping DT Slice -9    ----
 --Warping DT Slice -10    ----
 --Warping DT Slice -11    ----
 --Warping DT Slice -12    ----
 --Warping DT Slice -13    ----
 --Warping DT Slice -14    ----
 --Warping DT Slice -15    ----
 --Warping DT Slice -16    ----
 --Warping DT Slice -17    ----
 --Warping DT Slice -18    ----
 --Warping DT Slice -19    ----
 --Warping DT Slice -20    ----
 --Warping DT Slice -21    ----
 --Warping DT Slice -22    ----
 --Warping DT Slice -23    ----

In the old DT volume: 
 Coverd percentage = 98.2693% 

struct DTensor *nDT= 0x14050a70
NOTE: The warped NEW DT volume dimensions
        =(48x48x24)

saving resulting DT file to <Warped.Subj.dt>....
in SaveData(): object = 0x14050a70
file <Warped.Subj.dt> saved OK
new DT volume <Warped.Subj.dt> saved.
~DTVolume(): dt deleted

program completed.


~~~~~~~~~~~~~~~~
      feed back to xdr@cbmv.jhu.edu. Thanks
STDERR ******