<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Luis:</DIV>
<DIV> </DIV>
<DIV>Thank you so much. Now the output is correct.</DIV>
<DIV> </DIV>
<DIV>Best Regards</DIV>
<DIV> </DIV>
<DIV>Baoyun<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Luis Ibanez <luis.ibanez@kitware.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Baoyun Li <baoyun_li123@yahoo.com><BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> insight-users@itk.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, February 20, 2009 11:41:59 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: Istropic resampled CT image got fipped at y direction, and out of range<BR></FONT><BR>Hi Baoyun,<BR><BR><BR> Congratulations !<BR><BR> You just found a bug in the ITK Example.<BR><BR><BR><BR>The Example is missing to call the method<BR><BR> SetOutputDirection()<BR><BR>a fix has been committed to CVS<BR><A href="http://www.itk.org/cgi-bin/viewcvs.cgi/Examples/Filtering/ResampleVolumesToBeIsotropic.cxx?root=Insight&r1=1.21&r2=1.22&sortby=date"
target=_blank>http://www.itk.org/cgi-bin/viewcvs.cgi/Examples/Filtering/ResampleVolumesToBeIsotropic.cxx?root=Insight&r1=1.21&r2=1.22&sortby=date</A><BR><BR>Simply try adding the line:<BR><BR> resampler->SetOutputDirection( inputImage->GetDirection() );<BR><BR><BR>just after:<BR><BR> resampler->SetOutputOrigin( inputImage->GetOrigin() );<BR><BR><BR>Without this line, the filter is setting the direction of the<BR>output image to be an identity matrix (direction cosines),<BR>while, most likely, your in put image has a different type<BR>of direction.<BR><BR>You can always verify this by adding a print out:<BR><BR><BR> std::cout << inputImage->GetDirection() << std::endl<BR><BR><BR>--<BR><BR><BR>Please let us know if you still see any problem,<BR><BR><BR> Thanks<BR><BR><BR> Luis<BR><BR><BR>-------------------<BR>Baoyun Li wrote:<BR>> Dear All:<BR>> This is
regarding to yesterday's email, resampled image got out of range values for all voxel.<BR>> I am trying to resice the CT data to Isotropic, and the program I am using is ResampleVolumesToBeIsotropic.cxx for the ITK filter example.<BR>> Now I remove this :<BR>> resampler->SetOutputOrigin( inputImage->GetOrigin() );<BR>> and reader: origin1=inputImage->GetOrigin(),<BR>> the value for origin1 are all [0 0 0];<BR>> 1 if we set origin2=[0 0 0] and resampler->SetOutputOrigin(origin2),<BR>> I got all zeros value on the output image.<BR>> 2 if I set origin2=[0 -300 0], we saw most part of the CT image, but the image is fippled at top down direction from MRICro.<BR>> my input and out put are all hdr file, I tried nii data and have the same problem<BR>> Can somebody tell me how to solve the problem?<BR>> Baoyun<BR>> <BR>>
------------------------------------------------------------------------<BR>> *From:* Baoyun Li <<A href="mailto:baoyun_li123@yahoo.com" ymailto="mailto:baoyun_li123@yahoo.com">baoyun_li123@yahoo.com</A>><BR>> *To:* Luis Ibanez <<A href="mailto:luis.ibanez@kitware.com" ymailto="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</A>><BR>> *Cc:* <A href="mailto:insight-users@itk.org" ymailto="mailto:insight-users@itk.org">insight-users@itk.org</A><BR>> *Sent:* Thursday, February 19, 2009 4:53:30 PM<BR>> *Subject:* error when resampling the CT data to Isotropic<BR>> <BR>> <BR>> Dear All:<BR>> I am trying to resice the CT data to Isotropic, and the program I am using is ResampleVolumesToBeIsotropic.cxx for the ITK filter example.<BR>> My input data is called SE1.hdr<BR>> the space resolution is 0.7*0.7*2.5.<BR>> After I run the program, I got the output.hdr. The number of voxels and the
spacing of the output are correct after I check the result at MRICro. But all the voxel has the default outside value. Seems after the indentity transform, all the voxels are out of range.<BR>> Also I output the SmootherY results, it is ok.<BR>> Can any body let me know what happend? How to check the value of transform.<BR>> /////////////////////////////changes I made on the code<BR>> typedef short InputPixelType;<BR>> intensityWindowing->SetOutputMinimum( 0.0 );<BR>> intensityWindowing->SetOutputMaximum( 1200.0 ); // floats but in the range of chars.<BR>> typedef short OutputPixelType;<BR>> and some writers to record the interval output.<BR>> ////////////////////////<BR>> I also checked the results using NII as input and output, the resliced image contains all background value. I doubt the problem happend at the<BR>> typedef
itk::IdentityTransform< double, Dimension > TransformType;<BR>> TransformType::Pointer transform = TransformType::New();<BR>> transform->SetIdentity();<BR>> resampler->SetTransform( transform );<BR>> Can somebody help me to figure out this problem??<BR>> Thanks<BR>> Baoyun<BR>> <BR>> <BR></DIV></DIV></div><br>
</body></html>