Hi,

On 11/05/2012 12:23 PM, Miguel Nunes wrote:
> Hi!
>
> Regarding the QVTKRendering and the other pages I have been through them
> up and down several times. I dont know why I can´t understand it. Its
> just not clicking...
Well... it could of course mean that our documentation is not good 
enough... sometimes you will have to look at the MITK sources to see how 
some stuff is working in detail.

> 1.) Where can I find complete examples of mappers on your code/plugins?
You should search for sub-classes of the mitk::Mapper class. For example 
in the Mitk or MitkExt directories under MITK/Modules/

> 2.) Is this mapper thing a paradigm in c++/software engineering, or is
> it an internal implementation in MITK ?
No, it is a concept which is inherited by MITK from VTK.

> 3.) how can I use my rendering inside the QVTKRendering pipeline? I want
> to do a rendering engine that is portable and (hopefully) OS independent.
The term "rendering engine" is pretty generic, so I don't really know 
your requirements. Nevertheless, if you start writing a VTK mapper (as 
suggested earlier), you can of course make use of anything in your 
mapper implementation, e.g. functions from your rendering enginge.

> 4.) how can I put more example plugins (MITK-build\Plugins and
> MITK-build\Examples\Plugins) to work with the workbench or are MITK
> plugin examples running with other app ? or are these all integrated
> already with the workbench?
The functionality available in MITK workbench based applications is 
defined by the set of enabled plug-ins. If you have used the 
PluginGenerator tool (which is recommended) the generated executable 
will also find and incorporate the plugins from the MITK build.

Best,
Sascha


>
>
> Thanks for checking the error on my code.
>
> Wish you all a good week!
> Miguel
>
> On 03.11.2012 14:29, Sascha Zelzer wrote:
>> 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