<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Dear all,<div><br></div><div>I am trying to draw a 3D grid to show the nonrigid registration result by using GridImageSource.<font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px;"> However, there is 1/8 slices in each dimension of the grid volume are black, I found this is related to the gridSpacing.Fill(8), Is there anyway to make every slice has grid with no black slices in any dimension at all?</span></font></div><div><font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px;">The following code are used to set the parameters.</span></font></div><div><font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px;"><div> const unsigned int ImageDimension = 3;</div><div> typedef double PixelType;</div></span></font></div><div><font class="Apple-style-span" face="Geneva, Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px; "><div> typedef itk ::Image <PixelType , ImageDimension > ImageType;</div><div><br></div><div> // Instantiate the filter</div><div> typedef itk :: GridImageSource <ImageType > GridSourceType ;</div><div> GridSourceType :: Pointer gridImage = GridSourceType :: New ();</div><div> double scale = 255.0;</div><div> ImageType :: SizeType size;</div><div> ImageType :: PointType origin;</div><div> ImageType :: SpacingType spacing;</div><div> GridSourceType :: ArrayType gridSpacing;</div><div> GridSourceType :: ArrayType gridOffset;</div><div> GridSourceType :: ArrayType sigma;</div><div> GridSourceType :: BoolArrayType which;</div><div><br></div><div> // Specify image parameters</div><div> origin.Fill( 0.0 );</div><div> size.Fill( 128 );</div><div> spacing.Fill( 1.0 );</div><div><br></div><div> // Specify grid parameters</div><div> gridSpacing .Fill( 8.0 );</div><div> gridOffset.Fill( 0.0 );</div><div> sigma.Fill( 1 );</div><div> which.Fill( true );</div><div><br></div><div><br></div><div><br></div><div> // Specify 0th order B-spline function (Box function)</div><div> typedef itk :: BSplineKernelFunction <0> KernelType;</div><div> KernelType :: Pointer kernel = KernelType :: New ();</div><div><br></div><div>// Set parameters</div><div> gridImage -> SetKernelFunction ( kernel );</div><div> gridImage ->SetSpacing( spacing );</div><div><br></div><div> gridImage ->SetOrigin( origin );</div><div> gridImage ->SetSize( size );</div><div> gridImage -> SetGridSpacing ( gridSpacing );</div><div> gridImage -> SetGridOffset ( gridOffset );</div><div> gridImage -> SetWhichDimensions ( which );</div><div> gridImage ->SetSigma( sigma );</div><div> gridImage ->SetScale( scale );</div></span></font><br>--------------------------------<br>Xi Liang<br><br>ÁºÜç<br>--------------------------------<br><br><br></div>                                            <br /><hr />Hotmail: Trusted email with powerful SPAM protection. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Sign up now.</a></body>
</html>