[Insight-users] a black slice by using GridImageSource

Xi LIANG liangxi1986317 at hotmail.com
Thu Jan 28 02:38:33 EST 2010


Dear all,
I am trying to draw a 3D grid to show the nonrigid registration result by using GridImageSource. 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?
The following code are used to set the parameters.
  const    unsigned int    ImageDimension = 3;  typedef  double    PixelType; typedef itk ::Image <PixelType , ImageDimension > ImageType;
 // Instantiate the filter typedef itk :: GridImageSource <ImageType > GridSourceType ; GridSourceType :: Pointer gridImage = GridSourceType :: New (); double scale = 255.0; ImageType :: SizeType size; ImageType :: PointType origin; ImageType :: SpacingType spacing; GridSourceType :: ArrayType gridSpacing; GridSourceType :: ArrayType gridOffset; GridSourceType :: ArrayType sigma; GridSourceType :: BoolArrayType which;
 // Specify image parameters origin.Fill( 0.0 ); size.Fill( 128 ); spacing.Fill( 1.0 );
 // Specify grid parameters gridSpacing .Fill( 8.0 ); gridOffset.Fill( 0.0 ); sigma.Fill( 1 ); which.Fill( true );


 // Specify 0th order B-spline function (Box function) typedef itk :: BSplineKernelFunction <0> KernelType; KernelType :: Pointer kernel = KernelType :: New ();
//  Set parameters gridImage -> SetKernelFunction ( kernel ); gridImage ->SetSpacing( spacing );
 gridImage ->SetOrigin( origin ); gridImage ->SetSize( size ); gridImage -> SetGridSpacing ( gridSpacing ); gridImage -> SetGridOffset ( gridOffset ); gridImage -> SetWhichDimensions ( which ); gridImage ->SetSigma( sigma ); gridImage ->SetScale( scale );
--------------------------------
Xi Liang

梁茜
--------------------------------


 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100128/74361d8d/attachment.htm>


More information about the Insight-users mailing list