Running dcmtk application on iPhone

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

Running dcmtk application on iPhone

#1 Post by anjumsk29 »

Hi,

I have compiled DCMTK library for iOS and I am trying to call DCMImage library calls for creating image files from dcm file.

While accessing DcmImage function DcmImage->getStatus() it returns E_NOdata dictionary found.

Please let me know how to load data dictionary on iPhone device.

Thanks in advance

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#2 Post by Uli Schlachter »

Knowing what I had to look for, I googled for "dcmtk built-in data dictionary":

http://support.dcmtk.org/docs/file_datadict.html
(I think you want to read the "Using a built-in data dictionary" paragraph)

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#3 Post by anjumsk29 »

Hi DICOM team,

After going through datadic.txt file I am not getting what exactly to do for buil in data dictionary file.

1)My question is I am launching my application on iOS device and while using DICOMImage class it gives me error like E: cant load data dictionary.
Please let me know in easy steps how to load dicom.dic file

2) I am not getting when and how dicom.dic files get loaded and I dont know the reason also why it is not getting loaded on iOS device.

Please help.. Its urgent..
Thanks in advance.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

What exactly is unclear in the following paragraph (taken from the "datadict.txt" file)?
Also included in the sources is a pre-created built-in data dictionary
which can be used instead (dcmdata/libsrc/dcdictzz.cc). For example, the
project files for the Windows platform use this file instead of the default
(empty) built-in data dictionary. Under Unix environments it should also
be possible to selectively use a built-in data dictionary for specific
applications by including dcdictzz.o earlier in the link path than
libdcmdata.a (if your linker allows this).

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#5 Post by anjumsk29 »

I have not understood what changes to done in mkdictbi file and what changes to do in makefile.in for using built in data dictionary

I have all the compiled libraries with me then why should i compile it again for libdcmdata. I am totally confused by the below lines.

referring to this below text in datadic.txt file :-

The default built-in data dictionary code (dcmdata/libsrc/dcdictbi.cc)
currently does nothing. The code for a useful built-in data dictionary can
be regenerated at any time by the mkdictbi program (dcmdata/libsrc/mkdictbi)
and the dcmdata library makefile (dcmdata/libsrc/Makefile.in) includes a
target (builtindict) for this purpose. The makefile also includes a target
(nobuiltindict) to reset back to an empty built-in data dictionary. By
making the built-in data dictionary, rebuilding the libdcmdata.a library
and relinking all your applications will ensure that the built-in data
dictionary is used.

Also included in the sources is a pre-created built-in data dictionary
which can be used instead (dcmdata/libsrc/dcdictzz.cc). For example, the
project files for the Windows platform use this file instead of the default
(empty) built-in data dictionary. Under Unix environments it should also
be possible to selectively use a built-in data dictionary for specific
applications by including dcdictzz.o earlier in the link path than
libdcmdata.a (if your linker allows this).

Could you please tell me reason why dictionary is not loaded on iPhone OS device where it loads on simulator. ?
And how to load it.. in simple and easy steps.

Thanks

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#6 Post by J. Riesmeier »

Could you please tell me reason why dictionary is not loaded on iPhone OS device where it loads on simulator. ?
No, because I've never used the one or the other.

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#7 Post by anjumsk29 »

Please reply for below query:-

I have not understood what changes to done in mkdictbi file and what changes to do in makefile.in for using built in data dictionary

I have all the compiled libraries with me then why should i compile it again for libdcmdata. I am totally confused by the below lines.

referring to this below text in datadic.txt file :-

The default built-in data dictionary code (dcmdata/libsrc/dcdictbi.cc)
currently does nothing. The code for a useful built-in data dictionary can
be regenerated at any time by the mkdictbi program (dcmdata/libsrc/mkdictbi)
and the dcmdata library makefile (dcmdata/libsrc/Makefile.in) includes a
target (builtindict) for this purpose. The makefile also includes a target
(nobuiltindict) to reset back to an empty built-in data dictionary. By
making the built-in data dictionary, rebuilding the libdcmdata.a library
and relinking all your applications will ensure that the built-in data
dictionary is used.

Also included in the sources is a pre-created built-in data dictionary
which can be used instead (dcmdata/libsrc/dcdictzz.cc). For example, the
project files for the Windows platform use this file instead of the default
(empty) built-in data dictionary. Under Unix environments it should also
be possible to selectively use a built-in data dictionary for specific
applications by including dcdictzz.o earlier in the link path than
libdcmdata.a (if your linker allows this).

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#8 Post by anjumsk29 »

Hello DICOM team,

I have already gone through datadic.txt file I am not getting how to use built in data dictionary.

I have read all the statements mentioned in that file.
Please help me its urgent I am not able to load my application only as its not loading data dictionary on iOS.

Please help.

Thanks in advance.

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

#9 Post by Michael Onken »

Hi,

If the dictionary is built-in (into the binaries), it is naturally _always_ loaded. If you do not provide more details what is wrong, nobody will be able to help you.

Best regards,
Michael

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#10 Post by anjumsk29 »

Hi Michael,

Thanks for your reply but it didnot help me.. Since morning i was posting on forum but not getting any worth solution for my problem repasting here my problem. Please help me if u have a solution for it.

I have compiled DCMTK library for iOS and I am trying to call DCMImage library calls for creating image files from dcm file.

While accessing DcmImage function DcmImage->getStatus() it returns E_NOdata dictionary found.

After going through datadic.txt file I am not getting what exactly to do for buil in data dictionary file.

1)My question is I am launching my application on iOS device and while using DICOMImage class it gives me error like E: cant load data dictionary.
Please let me know in easy steps how to load dicom.dic file

2) I am not getting when and how dicom.dic files get loaded and I dont know the reason also why it is not getting loaded on iOS device.

3)I have used DCMDICTPATH env variable too but it didn't work.

After reading datadic.txt file ....
I have not understood what changes to done in mkdictbi file and what changes to do in makefile.in for using built in data dictionary

I have all the compiled libraries with me then why should i compile it again for libdcmdata. I am totally confused by the below lines.

referring to this below text in datadic.txt file :-

The default built-in data dictionary code (dcmdata/libsrc/dcdictbi.cc)
currently does nothing. The code for a useful built-in data dictionary can
be regenerated at any time by the mkdictbi program (dcmdata/libsrc/mkdictbi)
and the dcmdata library makefile (dcmdata/libsrc/Makefile.in) includes a
target (builtindict) for this purpose. The makefile also includes a target
(nobuiltindict) to reset back to an empty built-in data dictionary. By
making the built-in data dictionary, rebuilding the libdcmdata.a library
and relinking all your applications will ensure that the built-in data
dictionary is used.

Also included in the sources is a pre-created built-in data dictionary
which can be used instead (dcmdata/libsrc/dcdictzz.cc). For example, the
project files for the Windows platform use this file instead of the default
(empty) built-in data dictionary. Under Unix environments it should also
be possible to selectively use a built-in data dictionary for specific
applications by including dcdictzz.o earlier in the link path than
libdcmdata.a (if your linker allows this).

I m using this following code :-

DicomImage *dcmImage = new DicomImage(dcmFile);
if (dcmImage != NULL)
{
if (dcmImage->getStatus() == EIS_Normal)//It fails here says no data dictionary
{
if (dcmImage->isMonochrome())
{
dcmImage->setMinMaxWindow();
Uint8 *pixelData = (Uint8 *)(dcmImage->getOutputData(8 /* bits */));
if (pixelData != NULL)
{
bool ret = dcmImage->writeBMP(bmpFile);

if (ret) {
std::cout << "Succesfully written bmp file\n";
}else {

std::cout << "Error in writting\n";
}
}
}
} else
cerr << "Error: cannot load DICOM image (" << DicomImage::getString(dcmImage->getStatus()) << ")" << endl;
}

Please help me how to load data dictionary on iOS while application is launched.

We need DICOM team help!!!!!!!!!

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

#11 Post by Michael Onken »

Hi,

before I read further: What is exactly the status returned:
E_NOdata dictionary
does not exist. What is the exact error code? If it is actually EIS_NoDataDictionary then it really seems the dictionary is not loaded.


For a built-in dictionary:
In that case, did you _really_ use mkdictbi to generate the built-in dictionary, did you then _really_ re-compile dcmdata.lib and did you then _really_ re-link your application? If you also re-build dcmdump, for example, what is its output (before actually dumping the file)?

For an external (dicom.dic) dictionary:
Did you check whether the dicom.dic file was actually copied to your iOS device? Check whether it is in /usr/share/dcmtk/dicom.dic. (on the device!). If not, or not possible at all, set the DCMDICT environment variable to the location where dicom.dic is on the device, e.g. "/my/own/path/to/dicom.dic". Be sure that this is done BEFORE starting the application, and if possible (dont know how it works on iOS) check the variable yourself in the program code to make sure it points to the correct location.

Michael

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#12 Post by anjumsk29 »

Hi Michael,

Thanks for ur reply...
There is no way to copy or set environment variable on iPhone. iPhone does not support any dynamic loading.

Now my query is please give me steps how to use built in data dictionary. I have gone thru the datadic.txt file and I am not understanding its steps.. It would be great if u give me proper steps to use the built in data dictionary concept.

Thanks.

anjumsk29
Posts: 28
Joined: Tue, 2011-05-17, 14:34

#13 Post by anjumsk29 »

Thanks a lot Michael.. it really hepls.

Nitinyvj
Posts: 4
Joined: Tue, 2011-11-22, 07:24

Re: Running dcmtk application on iPhone

#14 Post by Nitinyvj »

anjumsk29 wrote:Hi,

I have compiled DCMTK library for iOS and I am trying to call DCMImage library calls for creating image files from dcm file.

While accessing DcmImage function DcmImage->getStatus() it returns E_NOdata dictionary found.

Please let me know how to load data dictionary on iPhone device.

Thanks in advance
Hi,

Even i have compiled the Dcmtk.xcodeproj and it compiled fine, but i am not able to understand how i could integrate these Dcmtk libraries in my existing iphone project. Can anyone help me on this.

Regards
Nitin

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

#15 Post by Michael Onken »

Hi,

in our howto section we have a link to an iOS tutorial.

Best regards,
Michael

Post Reply

Who is online

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