[vtkusers] vtkVolume16Reader, How to read raw files f rom 002.dcm.raw to 123.dcm.raw?
Peter Spring
meancity at gmail.com
Mon Dec 25 21:13:16 EST 2006
tcl code is below
vtkVolume16Reader reader
reader SetDataByteOrderToLittleEndian;
reader SetFilePrefix "d:\\rawdata\\"
reader SetFilePattern "%s%d.dcm.raw"
reader SetImageRange 2 123
[reader GetOutput] ReleaseDataFlagOn
reader SetDataSpacing ChangeToUrOwnValue
reader SetDataDimensions ChangeToUrOwnValue
reader Update
On 12/25/06, iii-lin <iii-lin at 163.com> wrote:
>
> hello everyone,
> I use dicom2 to convert 002.dcm....123.dcm to
> 002.dcm.raw....123.dcm.raw,and use the vtkVolume16Reader to read the raw
> files,but the v16.SetFilePattern("%s%3d.dcm.raw") has something wrong, In
> the output window:can not find d:\rawdata\ 2.dcm.raw ,how to set the
> patterns?Let d:\rawdata\002.dcm.raw could be readed.
>
> here are the codes.I use Java language
> //////////////////////////////////////////////////////////////
> vtkDICOMImageReader dicomReader = new vtkDICOMImageReader();
> dicomReader.SetDirectoryName("d:/dicom");
> dicomReader.Update();
> double[] dataSpacing = dicomReader.GetDataSpacing();
> System.out.println(dataSpacing[0] + ":" + dataSpacing[1] + ":" +
> dataSpacing[2]);
> vtkVolume16Reader v16 = new vtkVolume16Reader();
> v16.SetDataByteOrderToLittleEndian();
> v16.SetFilePrefix("d:/rawdata/");
> v16.SetFilePattern("%s%3d.dcm.raw");
> v16.SetImageRange(2, 123);
> v16.GetOutput().ReleaseDataFlagOn();
> v16.SetDataSpacing(dicomReader.GetDataSpacing());
> v16.SetDataDimensions(dicomReader.GetOutput().GetDimensions());
> v16.Update();
>
> Thread.sleep(10000);
> vtkImageGaussianSmooth GaussianSmooth = new vtkImageGaussianSmooth();
> GaussianSmooth.SetInput(v16.GetOutput());
> GaussianSmooth.SetDimensionality (3);
> GaussianSmooth.SetStandardDeviations(0.0,4.0);
> vtkContourFilter skinExtractor = new vtkContourFilter();
> skinExtractor.SetInput((vtkDataSet)GaussianSmooth.GetOutput());
> skinExtractor.SetValue(0, 500);
> skinExtractor.Update();
> vtkSmoothPolyDataFilter smoother=new vtkSmoothPolyDataFilter();
> smoother.SetInput(skinExtractor.GetOutput());
> smoother.SetNumberOfIterations(70);
> vtkPolyDataNormals skinNormals = new vtkPolyDataNormals();
> skinNormals.SetInput(smoother.GetOutput());
> skinNormals.SetFeatureAngle(60.0);
>
> vtkPolyDataWriter pdw=new vtkPolyDataWriter();
> pdw.SetInput(skinNormals.GetOutput());
> pdw.SetFileName("d:/out.vtk");
> pdw.Write();
>
>
> /////////////////////////////////////////
>
>
>
>
> 昨 天 和 女 友 b u y 疯 了 ! ! !
> 年 末 万 种 精 品 大 促 销 , 8 0 万 大 奖 天 天 送 ( 绝 对 保 真 )
> <http://adtaobao.allyes.com/main/adfclick?db=adtaobao&bid=600,597,58&cid=29985,198,1&sid=32501&show=ignore&url=http://www.taobao.com/theme/lucky_new_year/index.php>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061226/881c3765/attachment.htm>
More information about the vtkusers
mailing list