[vtkusers] vtkDICOMImageReader - reading ONLY the DICOM files in one folder

Mark Wyszomierski markww at gmail.com
Mon Apr 14 08:21:21 EDT 2008


Please always reply to the mailing list so everyone can search the
responses.

I  think in fact this sample I wrote shows how to handle the dicom reader
class encountering a non-dicom file:

http://devsample.org/index.php?option=com_content&task=view&id=49&Itemid=27

Give it a try,

Mark

On Mon, Apr 14, 2008 at 8:17 AM, <polys_poly at hotmail.com> wrote:

>  Thanks Mark for your reply.
>
> The thing is i am kind a newbie in VTK and i have no idea what an error
> listener is or how i can attach it to the DICOM reader. If you can give me
> some info about this i would really appreciate it.
>
> Thanks,
> Polys
>
>  *From:* Mark Wyszomierski <markww at gmail.com>
> *Sent:* Monday, April 14, 2008 3:07 PM
> *To:* polys_poly at hotmail.com
> *Cc:* VTK users group <vtkusers at vtk.org>
> *Subject:* Re: [vtkusers] vtkDICOMImageReader - reading ONLY the DICOM
> files in one folder
>
> I think I ran into the same problem awhile back. I attached an error
> listener to the DICOM reader, and it generates an error when a non-DICOM
> file is encountered. When this happens, I would check the error and if it
> was just a non-DICOM file I would continue processing. Not the best
> solution, but it worked.
>
> That was just for the demo projects I wrote, for actual image viewer stuff
> I used boost or native win32 methods for recursively going through a folder
> looking for only dcm files myself.
>
> Mark
>
> On Mon, Apr 14, 2008 at 8:03 AM, <polys_poly at hotmail.com> wrote:
>
> >  Hello,
> >
> > I want to read some DICOM images from a folder that also contains other
> > files (not DICOM) for example .txt files. I use the following code
> >
> > vtkDICOMImageReader* pRead = vtkDICOMImageReader::New();
> > pRead->SetDirectoryName(strPath.c_str());
> > pRead->Update();
> >
> > But when it tries to read a .txt file for example I get error. Is there
> > any way I can modify this code so I can read ONLY the DICOM images contained
> > in the specific folder?
> >
> > Thanks in advance,
> > Polys
> >
> > _______________________________________________
> > 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/20080414/d8d511b3/attachment.htm>


More information about the vtkusers mailing list