Hi Claudia,

please try including the implementation directly:

#include <itkSmartPointerForwardReference.txx>

Actually I don’t remember why, but sometimes this is necessary.

Best,
Tobi

------------------------------------------------------------
Tobias Schwarz
DKFZ
German Cancer Research Center (Deutsches Krebsforschungszentrum)
Member of the Helmholtz Association
Division of Medical & Biological Informatics E130
Im Neuenheimer Feld 280
D-69120 Heidelberg
Phone: 49-(0)6221-42-2353
Fax: 49-(0)6221-42-2345
E-Mail: [email protected]<mailto:[email protected]>
Web: www.dkfz.de<http://www.dkfz.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.

Von: Claudia Hänel [mailto:[email protected]]
Gesendet: Donnerstag, 29. Juli 2010 18:29
An: [email protected]
Betreff: Re: [mitk-users] Saving 3D data over time into one mitk::Image

Hi Michael,

I'm using Visual Studio 2008, ITK 3.16, MITK svn version 27/07/2010. The error 
means that a library is missing. I've included all headers that you've 
mentioned. I use CMake to set all properties for the project. Normally all 
include directories and additional libraries should be set. But I have to set 
some libraries manually (e.g. Qwt.lib) and I guess the missing one, too. That 
are all included libraries of my project:

$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib 
ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  Qmitk.lib 
mitkCore.lib mitkIpPic.lib mitkIpFunc.lib mbilog.lib vtkGraphics.lib 
vtkCommon.lib vtkFiltering.lib vtkftgl.lib vtkGraphics.lib vtkHybrid.lib 
vtkImaging.lib vtkIO.lib vtkParallel.lib vtkRendering.lib 
vtkVolumeRendering.lib vtkWidgets.lib vtkjpeg.lib vtkpng.lib vtkzlib.lib 
vtkexpat.lib vtkfreetype.lib ITKAlgorithms.lib ITKStatistics.lib ITKFEM.lib 
pic2vtk.lib IIL4MITK.lib ipSegmentation.lib ann.lib 
C:\Programme\Qt\lib\QtGuid4.lib imm32.lib winmm.lib 
C:\Programme\Qt\lib\QtCored4.lib ws2_32.lib vtkHybrid.lib vtkParallel.lib 
vtkexoIIc.lib vtkRendering.lib vtkGraphics.lib vtkverdict.lib vtkftgl.lib 
vtkImaging.lib vtkIO.lib vtkFiltering.lib vtkCommon.lib vtkDICOMParser.lib 
vtkNetCDF.lib vtkmetaio.lib vtksqlite.lib vtksys.lib vfw32.lib vtktiff.lib 
opengl32.lib vtkjpeg.lib vtkpng.lib vtkzlib.lib vtkexpat.lib vtkfreetype.lib 
ITKNumerics.lib itkNetlibSlatec.lib ITKBasicFilters.lib ITKIO.lib ITKNrrdIO.lib 
itkgdcm.lib itkjpeg12.lib itkjpeg16.lib itkopenjpeg.lib snmpapi.lib rpcrt4.lib 
itkpng.lib itktiff.lib itkjpeg8.lib ITKSpatialObject.lib ITKCommon.lib 
itkvnl_inst.lib itkvnl_algo.lib itkv3p_netlib.lib itkvnl.lib itkvcl.lib 
ITKMetaIO.lib comctl32.lib wsock32.lib itksys.lib ITKDICOMParser.lib 
ITKEXPAT.lib ITKniftiio.lib ITKznz.lib itkzlib.lib ws2_32.lib 
mitkDeformableRegistration.lib Qwt.lib mitkIpPic.lib

Regards,
Claudia

Zitat von Müller Michael <[email protected]>:

> Hi Claudia,
>
> i just compiled and executed a small program containing your code
> without any problems:
>
> #include <mitkImage.h>
> #include <mitkPicFileReader.h>
> #include <mitkImageDataItem.h>
> int main(int argc, char* argv[])
> {
>   mitk::PicFileReader::Pointer reader = mitk::PicFileReader::New();
>   const char * filename =
> "/local/muellerm/mitk/src/mitk/Core/Code/Testing/Data/Pic2DplusT.pic.gz";
>   reader->SetFileName(filename);
>   reader->Update();
>
>   mitk::Image::Pointer image = reader->GetOutput();
>   MITK_INFO << image;
>   mitk::Image::Pointer imageSeries = mitk::Image::New();
>   imageSeries->Initialize(image);
>   int time = 1;
>
>   // your code
>   mitkIpPicDescriptor* currentVolume
>       = image->GetVolumeData(0)->GetPicDescriptor();
>
> imageSeries->SetPicVolume(image->GetVolumeData(0)->GetPicDescriptor(),time);
>  // end of your code
>
>   MITK_INFO << imageSeries;
> }
>
> I am running Ubuntu with ITK 3.16. Unfortunately, I can`t remember if
> your Visual Studio compiler complains about incomplete types (as GCC
> does) or if the MS Linker just throws unresolved symbols errors.
> However, make sure that you have mitkImageDataItem.h included because
> mitk::ImageDataItem is just forward declared in mitkImage.h.
> So far I have no other idea what may be the cause of your error.
>
> Regards,
> Michael
>
> Von: Claudia Hänel [mailto:[email protected]]
> Gesendet: Donnerstag, 29. Juli 2010 15:57
> An: Schwarz Tobias
> Cc: [email protected]
> Betreff: Re: [mitk-users] Saving 3D data over time into one mitk::Image
>
> Hi,
>
> if I try it with
>
> mitkIpPicDescriptor* currentVolume =
> image->GetVolumeData(0)->GetPicDescriptor();
> imageSeries->SetPicVolume(image->GetVolumeData(0)->GetPicDescriptor(),time);
>
> I get a linking error
>
> error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall
> itk::SmartPointerForwardReference<class
> mitk::ImageDataItem>::~SmartPointerForwardReference<class
> mitk::ImageDataItem>(void)"
> (??1?$smartpointerforwardrefere...@vimagedataitem@mitk@@@itk@@q...@xz)".
>
> But I can't figure out which library is missing. itkCommon.lib (for
> itk::SmartPointerForwardReference) and mitkCore.lib (for
> mitk::ImageDataItem) are included
>
> Best regards,
> Claudia
>
>
> Zitat von Schwarz Tobias <[email protected]>:
>
>> Hi Claudia,
>>
>> I don't see any error in your code. I use a similar approach, which
>> works fine:
>>
>>   // initialize
>>   mitk::Image::Pointer image = mitk::Image::New();
>>   image->Initialize(mitk::PixelType(typeid(unsigned char)),
>> dimension, dimensions);  // dimension = 4
>>
>>   // Fill with zeroes (optional)
>>   unsigned int byteSize = sizeof(unsigned char);
>>   for (unsigned int dim = 0; dim < dimension; ++dim)
>>   {
>>     byteSize *= image->GetDimension(dim);
>>   }
>>   memset(image->GetData(), 0, byteSize );
>>
>>   // Fill a time step
>>   mitkIpPicDescriptor* currentVolume =
>> resultImage->GetVolumeData(0)->GetPicDescriptor();  // resultImage is
>> 3D
>>   image->SetPicVolume( currentVolume , currentTime );
>>                      // currentTime is counted up
>>
>>
>>
>> Could you please try it this way, too? Maybe there is a bug in
>> SetImportVolume().
>>
>> Best,
>> Tobi
>>
>>
>> ------------------------------------------------------------
>> Tobias Schwarz
>> DKFZ
>> German Cancer Research Center (Deutsches Krebsforschungszentrum)
>> Member of the Helmholtz Association
>> Division of Medical & Biological Informatics E130
>> Im Neuenheimer Feld 280
>> D-69120 Heidelberg
>> Phone: 49-(0)6221-42-2353
>> Fax: 49-(0)6221-42-2345
>> E-Mail: [email protected]
>> Web: www.dkfz.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.
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Claudia Hänel [mailto:[email protected]]
>> Gesendet: Mittwoch, 28. Juli 2010 10:20
>> An: [email protected]
>> Betreff: [mitk-users] Saving 3D data over time into one mitk::Image
>>
>> Hi,
>>
>> I want to write some 3D data over time into a mitk::Image.
>> What I do is the following:
>>
>> void MyImageData::Initialize(mitk::Image::Pointer image, int nrOfVolumes)
>> {
>>         unsigned int *d = image->GetDimensions();
>>         d[3] = nrOfVolumes;
>>
>>         imageSeries = mitk::Image::New();
>>         imageSeries->Initialize(image->GetPixelType(), 4,d,1);
>>
>>         initialized = true;
>> }
>>
>> bool MyImageData::pushDataBack(mitk::Image::Pointer image)
>> {
>>         if (initialized)
>>         {
>>                 imageSeries->SetImportVolume(image, time);
>>                 imageSeries->GetData();
>>                 imageSeries->Update();
>>
>>                 if(imageSeries->IsVolumeSet(time))
>>                 {
>>                         time++;
>>                         return true;
>>                 }
>>                 return false;
>>         }
>>         else
>>                 return false;
>>
>> }
>>
>> It works fine for the first image. After that I get exceptions in the
>> memory management. I tried all variants of
>> mitk::Image::ImportMemoryManagementType in the SetImportVolume-function.
>> As I understand the concept of mitk::Image I can save data with the
>> same region and data type over time just by increasing the time
>> variable, right?
>> Can anyone help me, please?
>>
>> Best regards,
>> Claudia
>>
>>
>>
>>
>
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to