addDicomFile

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

addDicomFile

#1 Post by nobnet »

function return ilegal parameter :
status= dicomdir.addDicomFile("ALBINA2.dcm");
How do I resolve that?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1459
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

The filename "ALBINA2.dcm" is not allowed in any of the application profiles, and the DICOMDIR classes check this, along with a number of other profile dependent checks.

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

adddicomfile

#3 Post by nobnet »

I only repeat your example below but it return ilegal parameter in addDicomFile("albina2.dcm").
Do I have to create any application profile or to change ?.If I am writing made a mistake, the more important. How do I resolve this problem.
I am a long time in this problem. help me please!
DicomDirInterface dicomdir;
OFCondition status = dicomdir.createNewDicomDir();
if (status.good())
{
while ( /* there are files */ )
status =dicomdir.addDicomFile( /* current filename */ );
cout<<status.text();
status = dicomdir.writeDicomDir();
if (status.bad())
cerr << "Error: cannot write DICOMDIR (" << status.text() << ")" << endl;
} else
cerr << "Error: cannot create DICOMDIR (" << status.text() << ")" << endl;

Thomas Wilkens
DCMTK Developer
Posts: 117
Joined: Tue, 2004-11-02, 17:21
Location: Oldenburg, Germany
Contact:

#4 Post by Thomas Wilkens »

One problem apparently is that you use a filename extension. "albina2.dcm" is invalid, "albina2" would be valid.

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

addDicomFile

#5 Post by nobnet »

I tried to do that(put "albina2") but it return: No such file or directory, and I already used this same form("albina2.dcm") in other program and it always functions.

What are the other suggestions ?.
thanks !

wrgben
Posts: 20
Joined: Thu, 2005-01-06, 10:53

#6 Post by wrgben »

This may seem obvious, but did you remove the .dcm extension from the file in question?

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

AddDicomFile

#7 Post by nobnet »

I tried to do that. with: "albina2.dcm" and "albina2". In the first case it return ilegal parameter and second it return No such file or directory.
What do I do?.
Thanks a lot for help me!.

DicomDirInterface dicomdir;
OFCondition status = dicomdir.createNewDicomDir();
if (status.good())
{
status =dicomdir.addDicomFile( "albina2");
cout<<status.text();
status = dicomdir.writeDicomDir();
if (status.bad())
cerr << "Error: cannot write DICOMDIR (" << status.text() << ")" << endl;
} else
cerr << "Error: cannot create DICOMDIR (" << status.text() << ")" << endl;

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

#8 Post by Jörg Riesmeier »

Please make sure that the name of the DICOM file you want to add (i.e. the one which is stored on your harddisk) is "albina2" and not "albina2.dcm" - this is what wrgben pointed out. Btw, lower case characters are also not allowed for the filenames on DICOM storage media. Of course, you could use enableMapFilenamesMode() to enable the automatic filename mapping.

Anyway, I would recommend that you first read the relevant parts of the DICOM standards before trying to create a DICOMDIR.

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

AddDicomdirFile

#9 Post by nobnet »

I don't know if I understand but you want I remove the .dcm extension from the file stored in harddisk?.If it was that, I did and the it return Storage media application profile violated. Did it almost perform correctly?.
if not . I hope that you continue help me!.
thanks.

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

#10 Post by Jörg Riesmeier »

It seems that the file you want to add does not conform to the requirements of the selected application profile (which is STD-GEN-CD by default). You could use setLogStream() to get more information on the problem or try the command line tool dcmgpdir/dcmmkdir which use the same class.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests