dcmtk on iPhone ??

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
elzix88
Posts: 12
Joined: Fri, 2010-11-19, 23:48

dcmtk on iPhone ??

#1 Post by elzix88 »

Is there anyone who have ever try to use dcmtk with his own iPhone/iPad application wrote in XCode ? I have app for Mac OS X with basic operations on dcm image (its working) and i want to change it for iOS platform. The problem is that the compiler display errors linked with librarys:

Code: Select all

ld: warning: in /opt/local/lib/libofstd.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmdata.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmimgle.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmimage.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libijg8.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libijg12.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libijg16.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmnet.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmjpeg.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmqrdb.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmsr.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmtls.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmdsig.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmwlm.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libdcmpstat.a, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libz.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libssl.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libtiff.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libcharset.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libpng12.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /opt/local/lib/libiconv.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

  "DJDecoderRegistration::cleanup()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DcmFileFormat::getDataset()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o
  "DJDecoderRegistration::registerCodecs(E_DecompressionColorSpaceConversion, E_UIDCreation, E_PlanarConfiguration, bool)", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DiJPEGPlugin::setQuality(unsigned int)", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "GlobalDcmDataDictionary::isDictionaryLoaded()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DcmFileFormat::DcmFileFormat()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DiJPEGPlugin::~DiJPEGPlugin()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DcmDataset::getOriginalXfer() const", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DicomImage::writePluginFormat(DiPluginFormat const*, __sFILE*, unsigned long)", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DicomImage::DicomImage(DcmObject*, E_TransferSyntax, unsigned long, unsigned long, unsigned long)", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DiJPEGPlugin::setSampling(E_SubSampling)", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "DiJPEGPlugin::DiJPEGPlugin()", referenced from:

      -[iPhone_DCMAppDelegate wczytaj:] in iPhone_DCMAppDelegate.o

  "_dcmDataDict", referenced from:

      _dcmDataDict$non_lazy_ptr in iPhone_DCMAppDelegate.o

     (maybe you meant: _dcmDataDict$non_lazy_ptr)

ld: symbol(s) not found
I know that the arch should be set to x86_64(like on my mac os x app) but there is no such option in this case. Is that possible to compile dcmtk on iOS ??

Maybe someone can tell me how to build dcmtk as i386 architecture using macports? (i can install dcmtk only by macport, becasue using basic way i have a lot of errors)
-----------------------------------------------
sorry for my english.
Best regards.

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

you have to cross-compile DCMTK in order to also run on the iPhone. I do not know how that iOS platform is called in XCode but you must have a DCMTK compiled with the same target platform selected.

Nobody from the DCMTK team did compile for iOS so far but I expect that it should be possible, maybe with some little adaptations. However, if someone provides an iPad for us we'll be sure to integrate that system ourselves :-)

Best regards,
Michael

elzix88
Posts: 12
Joined: Fri, 2010-11-19, 23:48

#3 Post by elzix88 »

Thank You for your reply. Your post was very helpfull for me.

You wrote me that what i want to read :) So i think i made a progress in this thread. I compile dcmtk with -arch i386 and my program compiled with no problems:) Now when i try to display a dicom image on iPhone simulator i get these errors ( in debug window, program is compiling with zero problems) :

Code: Select all

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_rwlock_init$UNIX2003 called from function _ZN15OFReadWriteLockC2Ev in image iPhone_DCM.
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_rwlock_rdlock$UNIX2003 called from function _ZN15OFReadWriteLock6rdlockEv in image iPhone_DCM.
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_rwlock_unlock$UNIX2003 called from function _ZN15OFReadWriteLock6unlockEv in image iPhone_DCM.

have anyone have idea what the problem is? I have no idea.... ;/

Thanks in advance for any reply !

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Maybe you use multi-threading in DCMTK (i.e. compile DCMTK with multi-threading) and the iPhone libraries do not permit you to call these threading system functions. You could try building DCMTK without threads (if you did). Just disable threads during CMake, and re-check while building with XCode or make. If you use configure/make for building DCMTK on Mac, use "./configure --disable-threads".

Best regards,
Michael

elzix88
Posts: 12
Joined: Fri, 2010-11-19, 23:48

#5 Post by elzix88 »

Thank you for your reply.

I was follow your instructions and use --disable-threads option. Now i have these errors:

Code: Select all

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
opendir$INODE64$UNIX2003 called from function _ZN10OFStandard9dirExistsERK8OFString in image iPhone_DCM.

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
strerror$UNIX2003 called from function _ZN15DcmFileProducerC2EPKcj in image iPhone_DCM.
any ideas?


edit: OK i did it ! :) It was problem with my code. Warnings are still appears but my application works. Thanks !

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#6 Post by Michael Onken »

Hi,

nice to hear that it works now, cool 8)

So, maybe you can write a short bullet list what has to be done to compile DCMTK for iPad/iPhone? I think that is interesting for some more users :-)

Thank you!
Michael

elzix88
Posts: 12
Joined: Fri, 2010-11-19, 23:48

#7 Post by elzix88 »

Hi,

1. before install you should remember to fix bug with dicom dictionary (in file dcdict.cc). Fix can be find in this forum.

2. all you need to do is configure dcmtk with these options (64 bits for Mac OS X and 32 for iOS):

Code: Select all

env ARCH='-arch i386 -arch x86_64' CFLAGS='-D_DARWIN_C_SOURCE -arch i386 -arch x86_64' CXXFLAGS='-D_DARWIN_C_SOURCE -arch i386 -arch x86_64' ./configure --prefix=/Users/bartek/full-dcmtk --disable-threads --with-libzlibinc=/Users/bartek/Desktop/dcmtk-3.5.4/zlib-1.2.5
2.a)make all
2.b) make install, make install-lib

3. remember about library order (FAQ 27) and about zlib library into your project

I think thats all (i spend a lot of time on my project and i dont remember if i done something else)

------------------------------------
I hope that it will be usefull for someone. Cheers !

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#8 Post by ali.m.habib »

elzix88 wrote:Hi,

1. before install you should remember to fix bug with dicom dictionary (in file dcdict.cc). Fix can be find in this forum.

2. all you need to do is configure dcmtk with these options (64 bits for Mac OS X and 32 for iOS):

Code: Select all

env ARCH='-arch i386 -arch x86_64' CFLAGS='-D_DARWIN_C_SOURCE -arch i386 -arch x86_64' CXXFLAGS='-D_DARWIN_C_SOURCE -arch i386 -arch x86_64' ./configure --prefix=/Users/bartek/full-dcmtk --disable-threads --with-libzlibinc=/Users/bartek/Desktop/dcmtk-3.5.4/zlib-1.2.5
2.a)make all
2.b) make install, make install-lib

3. remember about library order (FAQ 27) and about zlib library into your project

I think thats all (i spend a lot of time on my project and i dont remember if i done something else)

------------------------------------
I hope that it will be usefull for someone. Cheers !
Hi all,

I 'm totally new to DCMTK and I need to do the following :

- build DCMTK for iphone
I read a question and answer at

viewtopic.php?t=2759&sid=d6704678b50813 ... ecc31ca0d1

but I didn't understand how to do that

read DICOM image and display it to uiimageviewer

your reply is highly appreciated
Best regards

elzix88
Posts: 12
Joined: Fri, 2010-11-19, 23:48

#9 Post by elzix88 »

Look at the code of dcmtk2jpg program. I think you will find evertihing you need there.

Remember about that before you put dicom image to UIImage class you need to compress it to supported format e.g jpeg,png,bmp.

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#10 Post by ali.m.habib »

elzix88 wrote:Look at the code of dcmtk2jpg program. I think you will find evertihing you need there.

Remember about that before you put dicom image to UIImage class you need to compress it to supported format e.g jpeg,png,bmp.
- what about build the DCMTK tfor iphone could u give me more help

- where can I download the sourvce of dcmtk2jpg

I am totally new to DCMTK

if u can fgive me more details

Best regards

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#11 Post by Jörg Riesmeier »

I'm also not aware of any program called "dcmtk2jpg". Maybe, the original poster was referring to dcmj2pnm or img2dcm!? Both are part of the official source code package of DCMTK.

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#12 Post by ali.m.habib »

Jörg Riesmeier wrote:I'm also not aware of any program called "dcmtk2jpg". Maybe, the original poster was referring to dcmj2pnm or img2dcm!? Both are part of the official source code package of DCMTK.
ok could u help me in how to builkd it on mac os snow leopard

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#13 Post by Michael Onken »

Hi,

1) get the source code package of DCMTK 3.6.0
2) unpack it somewhere on your harddisk
3) Open a terminal and go to the unpacked DCMTK directory
4) enter ./configure, wait that it runs to the end, and then
5) enter make and wait again
6) call "sudo make install" if you want to install it to your computer

Alternatively, do 1) and 2) as above, then
3) Download, install and start CMake from Kitware
4) Enter in the first line the source code directory
5) In the second, tell CMake where it should put the compiled files
6) Hit the "configure" button
7) If asked, select "Xcode Project File" and wait that it runs through
8 ) Hit configure again (if necessary) or, as soon as available
9) Hit "generate" button
10) In the directory you told in the second line, you will now find something like DCMTK.xcode that you can open with Apple's XCode for compiling (hit "Build" or something like that)

Best regards,
Michael

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#14 Post by ali.m.habib »

Michael Onken wrote:Hi,

1) get the source code package of DCMTK 3.6.0
2) unpack it somewhere on your harddisk
3) Open a terminal and go to the unpacked DCMTK directory
4) enter ./configure, wait that it runs to the end, and then
5) enter make and wait again
6) call "sudo make install" if you want to install it to your computer

Alternatively, do 1) and 2) as above, then
3) Download, install and start CMake from Kitware
4) Enter in the first line the source code directory
5) In the second, tell CMake where it should put the compiled files
6) Hit the "configure" button
7) If asked, select "Xcode Project File" and wait that it runs through
8 ) Hit configure again (if necessary) or, as soon as available
9) Hit "generate" button
10) In the directory you told in the second line, you will now find something like DCMTK.xcode that you can open with Apple's XCode for compiling (hit "Build" or something like that)

Best regards,
Michael
I got this error

CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake
files:
TIFF_INCLUDE_DIR (ADVANCED)
used as include directory in directory /dcmtk-3.6.0
used as include directory in directory /dcmtk-3.6.0/config
used as include directory in directory /dcmtk-3.6.0/config/docs
used as include directory in directory /dcmtk-3.6.0/ofstd
used as include directory in directory /dcmtk-3.6.0/ofstd/libsrc
used as include directory in directory
/dcmtk-3.6.0/ofstd/include/dcmtk/ofstd
used as include directory in directory /dcmtk-3.6.0/oflog
used as include directory in directory /dcmtk-3.6.0/oflog/libsrc
used as include directory in directory
/dcmtk-3.6.0/oflog/include/dcmtk/oflog
used as include directory in directory /dcmtk-3.6.0/oflog/etc
used as include directory in directory

Errors occurred during the last pass

I used the following :
ccmake -GXcode /dcmtk-3.6.0
any suggestion

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#15 Post by Michael Onken »

Hi,

that's an error on the mac caused by the CMake configuration.. You can ignore it and go ahead anyway,i.e. hit configure again and go on.

If you want to fix it instead, unselect any boxes on the screen where the description contains the word TIFF ;)

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest