Hi,

On 10/30/2012 02:46 PM, Miguel Nunes wrote:
> thank you Sascha!
>
> OK, I think you understood what I want but, in any case, lets see if I
> can explain in a different way what I intend to do with my project and MITK.

Thanks for the detailed description. That is pretty much what I thought 
you are trying to do.

> I believe I will develop a new graphic engine from scratch by not using
> VTK or ITK, but a rather top notch, low level, high tuned graphic engine
> for volume rendering and data analysis.

If you are going to render *everything* yourself, you should be aware of 
the fact that you will probably not be able to take advantage of a 
couple of MITK functionalities which rely on an intact VTK based 
rendering pipeline.

> Right now I want to do some basic volume rendering to get a feel of MITK
> and how it works. I have a Ray tracing background on C/C++ and I am used
> to have access to all data structures (in that case: triangles,
> accelerating data structures and rays). I would generate a BVH with the
> triangles positions, and with that, access each pre-generated ray, and
> do the necessary calculations in order to obtain an image.
> So basically I just want to have access to these data structures,
> perform some ray casting to check for voxels information and generate a
> very basic image.
All right. In my opinion, the way to go (for a start) is to write your 
own VTK mapper. This ony means you should take advantage of the VTK 
class hierarchy and the integrated MITK rendering pipeline. How you draw 
the volume data from an image is still completely up to you. Have a look 
at MITK classes deriving from mitk::Mapper and how they use a VTK mapper 
to render data.

Inside a mitk::Mapper derived class, you have full access to the volume 
data by doing:

mitk::Image* image = dynamic_cast<mitk::Image*>(this->GetData());
void* data = image->GetData();

or get the data as a vtkImage instance:

vtkImage* vtkImg =  image->GetVtkImageData();

> MITK is a big framework, and I just cant find those data structures or
> how to access them. From the last email you sent, I am guessing I will
> have to "create a mapper" having my rendering engine and its properties
> in there. Unfortunately I do not understand the structure of MITK. The
> documentation, at least for me, isn't clear enough. Don“t you have a
> some drawings or UML graphics explaining the platform in general with
> the main classes, factories, mappers, etc. and how its all related?

We do have special pages for the different concepts in MITK. For the 
rendering pipeline, there is this one:

http://docs.mitk.org/nightly-qt4/QVTKRendering.html

But looking at some MITK mappers as examples will definitely help.

> Regarding the code I sent before, I get a << Unhandled exception at
> 0x000007fee71fa57b (Mitk.dll) in MyTest.exe: 0xC0000005: Access
> violation reading location 0x0000000000000090. >>
>
> I believe it is a null pointer at:
>         mitk::BaseData::Pointer   bdata = dnode->GetData();
>
> I am running this code on the MyView.cpp file that was created using the
> plugin generator. I haven't change any other file outside the source
> files provided in the plugin project.

Yes, you are calling mitk::DataStorage::GetNode(...) without an 
argument. This will always return NULL.

Usually, in your plugin you listen to "selection" events in the 
workbench and if that selection is a mitk::DataNode you do something 
with it. Or you get a data node from the mitk::DataStorage class by name 
or some predicate and check for NULL.

If you write a mapper, you won't have these "issues", since a mapper 
will already be attached to a data node.


- Sascha

>
>
> I am sure we can work all this out through easily :-)
> Best,
> Miguel
>
> On 30.10.2012 12:59, Sascha Zelzer wrote:
>> Hi,
>>
>> On 10/29/2012 06:07 PM, Miguel Nunes wrote:
>>> Hi Sascha,
>>>
>>> I have been checking the documentation and the code around workbench and
>>> I still cant understand how loading data is processed and where it is
>>> stored. I apologize, but I don't understand what these mappers are. I
>>> have been, for a week now, trying to understand and creating a simple
>>> example-plugin for me.
>> No problem. I have the feeling that I didn't fully understand what you
>> want to do. From your previous mails, I thought that you would like to
>> use custom visualization code and render certain data objects (medical
>> images, surfaces,...?) in a specific way. This is way I pointed you
>> into the "mappers" direction.
>>
>> Maybe it would help if you try again to explain your specific use case.
>>
>>> Is there any place (docs, example, thread) that discusses and explain
>>> this in detail?
>> We have a general "Concepts" site:
>> http://docs.mitk.org/nightly-qt4/Concepts.html
>>
>> While I think our documentation has improved a lot in the last year,
>> there are certainly topics on which we could improve.
>>
>>> I just want to know how to access the data I loaded into the workbench.
>>>
>>> I am trying to do, on my plugin cpp:
>>>
>>>          mitk::DataStorage::Pointer m_DataStorage;
>>>          mitk::IDataStorageReference::Pointer ref =
>>> this->GetDataStorageReference();
>>>
>>>          if (ref.IsNotNull()) m_DataStorage = ref->GetDataStorage();
>>>          else return;
>>>
>>>          mitk::DataNode::Pointer   dnode = m_DataStorage->GetNode();
>>>
>>>          mitk::BaseData::Pointer   bdata = dnode->GetData();
>>>          mitk::Geometry3D::Pointer geo3d = bdata->GetGeometry();
>>>
>>>
>>> does this make any sense? I get a error while running this, like there
>>> is no data. Should I get an "instance"? am I looking in the wrong place?
>> Looks approximately right, if you are trying to access existing data
>> from a plug-in (e.g. from inside a View). Could you please provide
>> more context information and exact error messages?
>>
>>> I am sorry but this is starting to be a little annoying.
>> No worries. As said above, maybe we should start over and try to state
>> your use-case in more detail.
>>
>> Best,
>> Sascha
>


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to