Hi guys,

thanks a lot, what are you saying i totally right, after the update the 
data are loaded. But when I am trinyg to display the image the 
application crash.

The code I wrote is the following :

     // Create a QApplication instance first
     QApplication eco3DApp(argc, argv);
     eco3DApp.setApplicationName("Eco 3D");

     QmitkRegisterClasses();

     mitk::StandaloneDataStorage::Pointer ds = 
mitk::StandaloneDataStorage::New();

     MyMITKDICOMReader myReader = MyMITKDICOMReader();

     mitk::DataNode::Pointer node = myReader.readPhilips3D("filePath");

     //ds->Add(node);
     mitk::Image::Pointer image = 
dynamic_cast<mitk::Image*>(node->GetData());

     //take a time
     mitk::ImageTimeSelector::Pointer timeSelector = 
mitk::ImageTimeSelector::New();

     int timeStep = 1;

     timeSelector->SetInput( image );
     timeSelector->SetTimeNr( timeStep );
     timeSelector->Update();
     //timeSelector->UpdateLargestPossibleRegion();


     mitk::Image::Pointer timeStepImage = timeSelector->GetOutput();

     mitk::DataNode::Pointer stepImageNode = mitk::DataNode::New();

     stepImageNode->SetData(timeStepImage);
     stepImageNode->Update();
     ds->Add(stepImageNode);

     QmitkRenderWindow renderWindow;

     // Tell the RenderWindow which (part of) the datastorage to render
     renderWindow.GetRenderer()->SetDataStorage(ds);

     // Initialize the RenderWindow
     mitk::TimeGeometry::Pointer geo = 
ds->ComputeBoundingGeometry3D(ds->GetAll());
     mitk::RenderingManager::GetInstance()->InitializeViews(geo);

     renderWindow.show();
     renderWindow.resize(400, 400); //256, 256 original
     renderWindow.move(QPoint(500, 100));

     return eco3DApp.exec();

When I launch it, it crash after the eco3DApp.exec() call, with this error

Unhandled exception at 0x020B55DA (MitkCore.dll) in AwesomeApp.exe: 
0xC0000005: Access violation reading location 0x00000000.

exactely in :

 > 
MitkCore.dll!mitk::ImageDataItem::ConstructVtkImageData(itk::SmartPointer<mitk::Image
 
const > iP) Line 234    C++

line 254 is :

const mitk::Vector3D vspacing = geom3d->GetSpacing();

Thanks for the help.

Cheers
Yari


Il 28.05.2015 10:12, Eisenmann, Matthias ha scritto:
> Hi Yari,
>
> we had a look at your problem during our bug squashing session. We can 
> reproduce the situation you described: After loading a 3D+t image only the 
> first volume is initialized.
>
> Are you just wondering why this is the case or does your application crash?
>
> In our cases this is not a problem. The other volumes are initialized 'on 
> demand' after calling the Update() method of ImageTimeSelector for a specific 
> time step.
>
> Let us give you a pointer to a working example: The binary threshold tool of 
> the segmentation plugin.
> In method mitk::BinaryThresholdTool::CreateNewSegmentationFromThreshold(...) 
> each volume of a time series is processed.
>
> Best,
> Matthias and Thomas
>
> -----Ursprüngliche Nachricht-----
> Von: yari mattei [mailto:yari.mat...@student.supsi.ch]
> Gesendet: Montag, 18. Mai 2015 14:32
> An: mitk-users@lists.sourceforge.net
> Betreff: [mitk-users] Read different volume
>
> Hi everybody,
>
> I manage to open a Philips3D DICOM (with mithDicomSeriesReader) and I get a 
> DataNode.
>
> I would like to show the 9 different time step contained in the DICOM file so 
> I tried to get an image from the node with:
>
> mitk::Image::Pointer image = dynamic_cast<mitk::Image*>(node->GetData());
>
> And to select the volume with:
>
>       mitk::ImageTimeSelector::Pointer time = mitk::ImageTimeSelector::New();
>
>       time->SetInput(image);
>       time->SetTimeNr(1);
>       time->Update();
>
>       mitk::Image::Pointer image4 = time->GetOutput();
>
>
>       mitk::StandaloneDataStorage::Pointer ds4 = 
> mitk::StandaloneDataStorage::New();
>       mitk::DataNode::Pointer node4 = mitk::DataNode::New();
>
>       node4->SetData(image4);
>
>       ds4->Add(node4);
>
> This works only if I set the TimeNr to 0. I check with the debugger the value 
> of the image and I see that there are 9 different volume but only the first 
> one has values inside (the others are NULL).
> This is part of the dump of the debugger :
> -        image    {m_Pointer=0x164978e0 {m_Channels={ size=1 }
> m_Volumes={ size=9 } m_Slices={ size=1872 } ...} } 
> itk::SmartPointer<mitk::Image>
>       -        m_Pointer    0x164978e0 {m_Channels={ size=1 } m_Volumes={
> size=9 } m_Slices={ size=1872 } ...}    mitk::Image *
>           +        [mitk::Image]    {m_Channels={ size=1 } m_Volumes={
> size=9 } m_Slices={ size=1872 } ...} MitkCore.dll!mitk::Image
>           +        mitk::SlicedData
> {m_LargestPossibleRegion={m_Index={m_Index=0x16497984 {0, 0, 0, 0, 0} }
> m_Size={m_Size=0x16497998 {224, ...} } } ...} mitk::SlicedData
>           +        m_Channels    { size=1 }
> std::vector<itk::SmartPointer<mitk::ImageDataItem>,std::allocator<itk::SmartPointer<mitk::ImageDataItem>
>   > >
>           -        m_Volumes    { size=9 }
> std::vector<itk::SmartPointer<mitk::ImageDataItem>,std::allocator<itk::SmartPointer<mitk::ImageDataItem>
>   > >
>                           [size]    9    int
>                           [capacity]    9    int
>                 +        [0]    {m_Pointer=0x1641ba88 {m_Data=0x235b0040
> "" m_PixelType=0x164af8a8 {m_ComponentType=1 m_PixelType=SCALAR (1) ...} ...} 
> } itk::SmartPointer<mitk::ImageDataItem>
>                 +        [1]    {m_Pointer=0x00000000 <NULL> }
> itk::SmartPointer<mitk::ImageDataItem>
>                 +        [2]    {m_Pointer=0x00000000 <NULL> }
> itk::SmartPointer<mitk::ImageDataItem>
>                 +        [3]    {m_Pointer=0x00000000 <NULL> }
> itk::SmartPointer<mitk::ImageDataItem>
>                   .......
>
>
> Does anyone have any idea of what cause di problem?
>
> Thanks in advance
>
> Yari
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications Performance 
> metrics, stats and reports that give you Actionable Insights Deep dive 
> visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> mitk-users mailing list
> mitk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to