<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><span>Hi Bao,</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>I basically used the example provided in the itk package for GPU Demons: itkGPUDemonsRegistrationFilterTest.cxx</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Here are some important parts of my code:</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="background-color:
transparent;"><span><font face="times new roman, new york, times, serif"><div style="background-color: transparent;">const unsigned int Dimension = 3;</div><div style="background-color: transparent;">typedef float PixelType;</div></font></span></div><div style="background-color: transparent;"><span><font face="times new roman, new york, times, serif">typedef float InternalPixelType;</font><br></span></div><div style="background-color: transparent;"><span><font face="times new roman, new york, times, serif"><div style="background-color: transparent;">typedef itk::Vector< float, Dimension > VectorPixelType;</div><div style="background-color: transparent;">typedef itk::GPUImage< VectorPixelType, Dimension
> DeformationFieldType;</div><div style="background-color: transparent;">typedef itk::GPUDemonsRegistrationFilter< <span style="background-color: transparent;">InternalImageType, </span><span style="background-color: transparent;">InternalImageType, </span><span style="background-color: transparent;">DeformationFieldType> RegistrationFilterType;</span></div><div style="background-color: transparent;"><span style="background-color: transparent;">RegistrationFilterType::Pointer filter = RegistrationFilterType::New();<br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"><br></span></div><div style="background-color: transparent;"><span style="background-color: transparent;"><div style="background-color: transparent;">typedef itk::WarpImageFilter< <span
style="background-color: transparent;"> MovingImageType, </span><span style="background-color: transparent;"> MovingImageType, </span><span style="background-color: transparent;"> DeformationFieldType > WarperType;</span></div><div style="background-color: transparent;"><span style="background-color: transparent;"><div style="background-color: transparent;">typedef itk::LinearInterpolateImageFunction< <span style="background-color: transparent;"> MovingImageType, </span><span style="background-color: transparent;"> double > InterpolatorType;</span></div><div style="background-color: transparent;"><span style="background-color: transparent;"><div style="background-color: transparent;">WarperType::Pointer warper = WarperType::New();</div><div style="background-color: transparent;">InterpolatorType::Pointer interpolator =
InterpolatorType::New();</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"><span style="background-color: transparent;">warper->SetInput( movingImage );</span><br></div><div style="background-color: transparent;">warper->SetInterpolator( interpolator );</div><div style="background-color: transparent;">warper->SetOutputSpacing( fixedImage->GetSpacing() );</div><div style="background-color: transparent;">warper->SetOutputOrigin( fixedImage->GetOrigin() );</div><div style="background-color: transparent;">warper->SetOutputDirection( fixedImage->GetDirection() );</div><div style="background-color: transparent;">warper->SetOutputSize(fixedImage->GetLargestPossibleRegion().GetSize());</div><div style="background-color: transparent;">warper->SetEdgePaddingValue(0);</div></span></div></span></div></span></div></font></span></div><div style="font-family: 'times new
roman', 'new york', times, serif; font-size: 12pt;"></div><div><font face="times new roman, new york, times, serif">warper->SetDisplacementField( filter->GetOutput() );</font></div><div><font face="times new roman, new york, times, serif">warper->Update();</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">fixedImage and movingImage are both matrices with the size of 64x64x64 (float).</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">Peymon</font></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><br></div> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2"
face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Baohua Wu <baowu99@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Peymon Gazi <peymon.gazi@yahoo.com>; insight-users@itk.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, December 11, 2012 5:04 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] warper filter too slow<br> </font> </div> <br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv422218385">
<style></style>
<div>
<div><font size="2" face="Arial">Hi Peyman,</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Coud you tell us which image warping filter you
use? It would be nice to show some code here. Thank you!</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Bao</font></div>
<blockquote style="BORDER-LEFT:#000000 2px solid;PADDING-LEFT:5px;PADDING-RIGHT:0px;MARGIN-LEFT:5px;MARGIN-RIGHT:0px;">
<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-family: arial;">----- Original Message ----- </div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-family: arial; background-color: rgb(228, 228, 228); background-position: initial initial; background-repeat: initial initial;"><b>From:</b>
<a rel="nofollow" title="peymon.gazi@yahoo.com" ymailto="mailto:peymon.gazi@yahoo.com" target="_blank" href="mailto:peymon.gazi@yahoo.com">Peymon
Gazi</a> </div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-family: arial;"><b>To:</b> <a rel="nofollow" title="insight-users@itk.org" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a> </div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-family: arial;"><b>Sent:</b> Tuesday, December 11, 2012 7:00
PM</div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-family: arial;"><b>Subject:</b> [Insight-users] warper filter
too slow</div>
<div><br></div>
<div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; color: rgb(0, 0, 0); font-size: 12pt;">
<div>Hi all,<br>I'm using a multi-resolution Demons registration framework to
register two data sets. I use the filter implemented on GPU. It works fine;
however the it takes a long time to warp the moving image using the
displacement filter. My datasets are 2 64x64x64 (float) matrices, the whole
demons registration process takes less than a minute, but the warping step
takes about 10 minutes. <br>Any ideas?</div>
<div>Peymon<br></div></div>
<div>
</div><hr>
_____________________________________<br>Powered by
<a target="_blank" href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects
at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers
ITK Training Courses, for more information
visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep
messages on-topic and check the ITK FAQ
at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to
subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div>
</div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div> </div></body></html>