Hi Hortense,
I haven't worked with multi channel images yet, but why do you want to 
copy one channel that is contained in your multi channel image and place 
it to a child node of that multi channel image in the first place?

I would assume, that you need to deep-copy the data in the channel to a 
separate mitk::Image and then you can add it to the new node.

Best,
Ingmar


Am 14.04.2014 17:44, schrieb Hortense KIRISLI:
> Hi all,
>
> I am currently experimenting with multi-channel MITK images.
>
> Though I succeeded to create a multi-channel MITK image and to add it as
> a node in the datamanager, I am encountering some issue when trying to
> access each channel of the created node.
>
> Basically, what I would like to do is:
>
> -Click on my node containing the created multi-channel MITK image in the
> datamanager
>
> -Create N child nodes containing MITK image, corresponding to each channel
>
> Part of my code:
>
> if( parentNode.IsNotNull() &&
> dynamic_cast<mitk::Image*>(parentNode->GetData()) )
>
> {
>
>         MITK_INFO << "Check if multi-channel image...";
>
>         mitk::Image::Pointer parentImage =
> (dynamic_cast<mitk::Image*>(parentNode->GetData()));
>
> bool isMultiChannel(false);
>
> if (parentNode->GetBoolProperty("isMultiChannel", isMultiChannel))
>
>         {
>
> unsigned int idx_channel = 0;
>
> while (parentImage->IsValidChannel(idx_channel))
>
>               {
>
>                      MITK_INFO << "Reading image of channel #" <<
> idx_channel;
>
>                      mitk::Image::ImageDataItemPointer channelImage =
> parentImage->GetChannelData(idx_channel);
>
>                      mitk::DataNode::Pointer dataNode =
> mitk::DataNode::New();
>
>                      dataNode->SetData( ????? ) ;
>
> this->GetDataStorage()->Add( dataNode, parentNode );
>
> this->FireNodeSelected( dataNode);
>
>                      idx_channel++;
>
> }
>
> return;
>
>         }
>
> …
>
> }
>
> My problem is that I do not see what I should put as argument in
> SetData(), as it does not take ImageDataItemPointer type, and expect
> BaseData.
>
> Any hint is welcome J!
>
> Best,
>
> Hortense
>
> *----*
>
> *Hortense KIRISLI, PhD*
>
> /Research & Development Engineer/
>
> AQUILAB
>
> Parc Eurasanté – Lille Métropole
>
> Bâtiment Hermès
>
> 250 rue Salvador Allende
>
> 59120 Loos Les Lille - France
>
> Tel. +33 3 69 61 51 65
>
> www.aquilab.com <http://www.aquilab.com>
>
> AQUILAB
>
> ----
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
>
>
>
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to