[ITK] [ITK-users] Export specific frame/slice of multiframe dicom file: ExtractSliceImageFilter?

Timothee Evain tevain at telecom-paristech.fr
Tue Sep 1 04:31:42 EDT 2015


Hello Marcos,

You can extract one slice from your 3D data with itk::ExtractImageFilter
You have to specify the region you want to get as indicated here http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html
More precisely, you have to indicate the index of the slice you want and set the third dimension size to 0.
For example, saying you have an image 250x250x250 and you want the 89th slice you have to set:
RegionSize = {250,250,0}
RegionIndex = {0,0,89}

The filter return a 2D image when you collapse the third dimension.

I think this can be what you want ?

Tim

----- Mail original -----
De: "Marcos" <fotosentido at gmail.com>
À: insight-users at itk.org
Envoyé: Mardi 1 Septembre 2015 09:45:00
Objet: Re: [ITK] [ITK-users] Export specific frame/slice of multiframe	dicom	file: ExtractSliceImageFilter?

Hi, 

the input of vtkJPEGWriter: 

template < class T > 
void Exporter :: exportImage ( QString fileName , QVTKWidget * widget ) 
{ 
vtkWindowToImageFilter * filter = vtkWindowToImageFilter :: New (); 
filter -> SetInput ( widget -> GetRenderWindow ()); 

vtkSmartPointer < T > writer = vtkSmartPointer < T >:: New (); 
writer -> SetFileName ( fileName . toStdString (). c_str ()); 
writer -> SetInputConnection ( filter -> GetOutputPort ()); 

writer -> Write (); 
} 

T can be an vtkJPEGWriter, vtkPNGWriter, etc. 
I set the slice with vtkImageViewer2::GetSlice() 
But this depends on the vtk renderwindow, and its size,... 

That's why I need to do it with ITK, unless I can export the original frame with VTK. 

Thank you. 

2015-09-01 1:16 GMT+02:00 Siavash Khallaghi < siavashk at ece.ubc.ca > : 


Hi Marcos, 

How do you set the input of your vtkJPEGWriter? 

Siavash 



-- 
View this message in context: http://itk-users.7.n7.nabble.com/ITK-users-Export-specific-frame-slice-of-multiframe-dicom-file-ExtractSliceImageFilter-tp36081p36084.html 
Sent from the ITK - Users mailing list archive at Nabble.com. 
_____________________________________ 
Powered by www.kitware.com 

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html 

Kitware offers ITK Training Courses, for more information visit: 
http://www.kitware.com/products/protraining.php 

Please keep messages on-topic and check the ITK FAQ at: 
http://www.itk.org/Wiki/ITK_FAQ 

Follow this link to subscribe/unsubscribe: 
http://public.kitware.com/mailman/listinfo/insight-users 


_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users

_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list