load and display heavy dicom series

Hi everyone,
my goal is to load and display two dicom series into my own application in two different threads, so I decided to use vtk dicom loader. I use this code snippet: https://vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries
Everything works well with light dcm series (size is around 20mb for each series) but when it comes to heavier series (around 200mb), my application crashes with this kind of error messages “malloc(): unsorted double linked list corrupted” or “malloc.c:4036: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)’ failed”
Has anyone encountered this kind of problem with heavy dicom files? Thank you for your help…

200MB DICOM file is about average size (if not compressed), it should be no problem at all to load two of these. I usually recommend to have 10x more memory space for an application than the raw input data size - then you don’t have to be concerned about memory usage. So, for 2x200MB input data, 4GB memory should be enough. Make sure you configure virtual memory/swap size in your operating system accordingly and of course build a 64-bit application.

Thank you @lassoan for sharing with me these details, I guess I made a mistake in my code…

Ok, I have another question about vtk: is vtk thread safe?

For the most part, VTK should be considered not thread safe. Certain functions are thread safe, and are typically documented as such. That said, if you want to run VTK in a multithreaded application, you can, but you’ll want to perform all VTK operations in one thread.

ok, thank you @cory.quammen

I have one last question to ask. When I run my binary file, my console prints out these error messages:

2020-09-04 16:00:18.537 (0.943s) [DD2FC700] vtkAlgorithm.cxx:860 ERR|vtkOpenGLTextMapper (0x7fc9d00281b0): FillInputPortInformation is not implemented.

2020-09-04 16:00:18.537 (0.943s) [DDAFD700] vtkAlgorithm.cxx:860 ERR|vtkOpenGLTextMapper (0x7fc9d80281b0): FillInputPortInformation is not implemented.

2020-09-04 16:00:18.538 (0.943s) [DD2FC700]vtkDemandDrivenPipeline:666 ERR|vtkCompositeDataPipeline (0x7fc9d002cda0): Input port 0 of algorithm vtkOpenGLTextMapper(0x7fc9d00281b0) has 0 connections but is not optional.

2020-09-04 16:00:18.538 (0.943s) [DDAFD700]vtkDemandDrivenPipeline:666 ERR|vtkCompositeDataPipeline (0x7fc9d802cda0): Input port 0 of algorithm vtkOpenGLTextMapper(0x7fc9d80281b0) has 0 connections but is not optional.

@cory.quammen do you have any idea where these errors come from? Thank you for your patience

I’m afraid I don’t.