Hi Remco!
> I'm working on a image viewer that uses dcmtk to communicate over a
> network with a DICOM archive. So instead of loading the images from file
> our viewer receives the images over a network. It then needs to combine
> these images to a volume and display the volume on the screen using MIP
> and MPR. The user then needs to be able to navigate through the volume.
>
> I will investigate the method you described. The DcmDatasets contains an
> array with the pixel data so I guess it should work. What kind of format
> does the SetSlice method expect for the memory pointed to by its data
> parameter?
>
Just a pointer to the data vector, i.e., a standard c array, allocated
somewhere with new,
e.g.: myCarray = new unsigned char[512*512];
> I have already been working on a VTK source (a filter with no inputs)
> that takes a list of images as a parameter and that has the
> corresponding vtkImageData as output. Is it maybe possible to reuse this
> VTK source in MITK?
>
Yes. Assuming an instance of your source is "reader":
image->Initialize( reader->GetOutput() );
image->SetVolume( reader->GetOutput()->GetScalarPointer());
The method mitk::VtkImageReader::GenerateData() in
mitkVtkImageReader.cpp does
something similar.
Best regards,
Ivo
> Regards,
>
> Remco
>
> -----Original Message-----
> From: Ivo Wolf [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 06, 2008 10:59 AM
> To: Remco Harmsen
> Cc: [email protected]
> Subject: Re: [mitk-users] Interfacing between dcmtk and mitk
>
> Hi Remco,
>
> I am not familiar with the details of dcmtk, so I can only guess. If the
> DcmDataset contains an array with the data vector of the image, then
> it is possible to use this directly with an mitk::Image.
>
> First, you have to initialize the mitk::Image with some header
> information
> about the pixel type and the dimensions of the image using one of the
> mitk::Image::Initialize methods. This should be somehow available from
> the dcmtk object.
>
> Secondly, you have to put the actual data vector into the image. There
> are several methods in mitk::Image for doing this. In case you have a
> 3D image which is stored slice-by-slice (i.e., you need to combine
> several DcmDataset objects, each containing one slice of an image,
> into an image volume), you can use SetSlice or SetImportSlice.
> If DcmDataset contains the complete image, use SetChannel or
> SetImportChannel, or (alternatively, if the dimension is <=3)
> SetVolume or SetImportVolume.
>
> The SetImportXXX variants have one additional parameter compared
> to the the SetXXX methods:
> ImportMemoryManagementType importMemoryManagement =
> CopyMemory,
> see for example
> http://www.mitk.org/documentation/doxygen/classmitk_1_1Image.html#a14
>
> The default value CopyMemory means that the memory is copied (surprise
> ;-)).
> The mitk::Image will manage the copied memory, and will not touch the
> original data vector.
> In case you can somehow tell the DcmDataset not to care about the
> memory it has allocated for its data vector, you can use ManageMemory.
> In this case, the mitk::Image will take over the control of the memory
> and
> delete it when it is destroyed (using the c++ operator delete, so this
> only
> works in case the memory is allocated using new and NOT in case it was
> allocated by malloc!). The third possibility is ReferenceMemory or,
> equivalently, DontManageMemory. This the mitk::Image will just reference
> the data vector. Then it is your responsibility that the data vector
> exists at
> least as long as the mitk::Image exists and that it is freed at some
> time (if
> you do not want to have a memory leak).
>
> If you want to implement all this as a file-based mitk reader take a
> look
> at the page on the DataTreeNodeFactory:
> http://www.mitk.org/documentation/doxygen/group__IO.html#DataTreeNodeFac
> tory
> (just this section, NOT the XML stuff). I am not sure whether this is
> applicable for your case. Do you plan to run dcmtk as a DICOM server
> or do you want to use it to read files from a disk?
>
> Best regards,
>
> Ivo
>
> Remco Harmsen wrote:
>
>> Hi all,
>>
>> I want to interface between dcmtk (see http://dicom.offis.de) and
>>
> mitk.
>
>> More specifically: I would like to read a list of DICOM images stored
>>
> in
>
>> memory as a dcmtk objects (whose type is DcmDataset) and display them
>> using mitk. My question is: how can I do this? Do I need to store the
>> images to file and then read them again using mitk? Or is it maybe
>>
> also
>
>> possible to read the images directly from memory?
>>
>> Thanks in advance,
>>
>> Remco Harmsen
>>
>>
>>
>>
> ------------------------------------------------------------------------
> -
>
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>
> challenge
>
>> Build the coolest Linux based applications with Moblin SDK & win great
>>
> prizes
>
>> Grand prize is a trip for two to an Open Source event anywhere in the
>>
> world
>
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>
>>
--
----------------------------------------------------------------------
Dr. Ivo Wolf, Dipl.-Phys. Phone: (+49) 6221/42-2327
Deutsches Krebsforschungszentrum Fax: (+49) 6221/42-2345
Div. Medical and Biological Informatics (E130)
Im Neuenheimer Feld 280 email: [EMAIL PROTECTED]
D-69120 Heidelberg, Germany http://mbi.dkfz-heidelberg.de
----------------------------------------------------------------------
Confidentiality Note: This message is intended only for the use of the
named
recipient(s) and may obtain confidential and/or privileged information.
If you
are not the intended recipient, please contact the sender and delete the
message.
Any unauthorized use of the information contained in this message is
prohibited.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users