[vtkusers] vtkDICOMImageReader: skip reading some images ???

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Mar 25 13:24:17 EDT 2009


 vtkDirectory* dir = vtkDirectory::New();
 dir->Open( my_path );
 vtkStringArray *files = dir->GetFiles();
 // Let's keep only the first 20 (modify code to suit requirement).
 files->Resize( 20 );
 vtkGDCMImageReader *reader = vtkGDCMImageReader::New();
 reader->SetFileNames( files );
 reader->Update();

On Wed, Mar 25, 2009 at 6:12 PM,  <wassim_belhadj at topnet.tn> wrote:
> Hi
> I'm using now vtkDICOMImageReader and i don't know how to use
> vtkGDCMImageReader!!.
> For now I use the following code:
>
>                        dicomReader = vtkDICOMImageReader::New();
>                        dicomReader->SetDirectoryName(dirname);
>                        dicomReader->Update();
> Can you please tell me how to start?
> Thank you
> On Wed, 25 Mar 2009 18:03:32 +0100, Mathieu Malaterre
> <mathieu.malaterre at gmail.com> wrote:
>> Send me the current piece of code you are using (SetFileNames API) and
>> I'll fix it for you.
>>
>> On Wed, Mar 25, 2009 at 5:56 PM,  <wassim_belhadj at topnet.tn> wrote:
>>> Hi,
>>> Thank you for your reply.
>>> can you can you tell me please How to solve my problem using this class
>>> "vtkGDCMImageReader"?
>>> As I told, I want to skip reading some images of my directory (e.g:
>>> reading
>>>  from image  50 until 150  of a directory which contains 200 images ).
>>> A piece of source code will be welcome.
>>> Thank you in advance.
>>>
>>>
>>>
>>>
>>> On Wed, 25 Mar 2009 17:43:19 +0100, Mathieu Malaterre
>>> <mathieu.malaterre at gmail.com> wrote:
>>>> On Wed, Mar 25, 2009 at 5:27 PM,  <wassim_belhadj at topnet.tn> wrote:
>>>>> Hi
>>>>> I'm using  vtkDICOMImageReader for reading DICOM Image.
>>>>> My directory contains 200 images(IMG0001 ------> IMG0200)
>>>>> I want to skip reading some images
>>>>> For example reading  from image  50 until 150 ((IMG0050 ------>
>>> IMG0150).
>>>>> How to do this please.
>>>>> Thank you in advance.
>>>>
>>>> Short answer you cannot.
>>>> vtkDICOMImageReader did not implement neither the
>>>> SetFilePattern/SetFilePrefix nor the SetFileNames API, you may want to
>>>> report a bug report for that at: http://vtk.org/Bug.
>>>>
>>>> You could use vtkGDCMImageReader as it provides a -better- replacement
>>>> for vtkDICOMImageReader, and implements a more flexible API
>>>> (SetFileNames is implemented).
>>>>
>>>> 2cts
>>>
>



-- 
Mathieu



More information about the vtkusers mailing list