[ITK-users] Creating 3D dome using ITK

sidharta sidharta.gupta93 at gmail.com
Wed May 10 08:06:45 EDT 2017


I tried the EllipseSpatialObject as follows:

int EllipseSpatialObjectToImage(InputImageType::Pointer binaryImage){

	typedef itk::EllipseSpatialObject<Dimension> EllipseType;
	EllipseType::Pointer ellipse = EllipseType::New();

	ellipse->SetRadius(0.5 / binaryImage->GetSpacing()[0]);
	ellipse->SetDefaultInsideValue(1.0);
	ellipse->SetDefaultOutsideValue(0.0);

	typedef itk::SpatialObjectToImageFilter<EllipseType, InputImageType>
SpatialObjectToImageFilterType;
	SpatialObjectToImageFilterType::Pointer filter =
SpatialObjectToImageFilterType::New();

	int d = 1.0 / binaryImage->GetSpacing()[0];
	InputImageType::SizeType size;
	size.Fill(d);
	filter->SetSize(size);

	filter->SetInsideValue(255);
	filter->SetOutsideValue(0);

	double O[3] = { 0, 0, 0 };
	filter->SetOrigin(O);
	filter->SetInput(ellipse);

	filter->Update();

	int flag = FileWriter(filter->GetOutput(),
"C:/Users/api/Desktop/3D_mask_ellipse.mhd");
	if (!flag)
		return EXIT_FAILURE;
	else
		return EXIT_SUCCESS;
}
But I get a blank image unfortunately. How would I get hemi-sphere from
this? Just cropImageFilter?


Thank you
Sidharta



--
View this message in context: http://itk-users.7.n7.nabble.com/Creating-3D-dome-using-ITK-tp38201p38210.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list