Can't add dicom file in DIRDICOM?No such file or dicternary

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Can't add dicom file in DIRDICOM?No such file or dicternary

#1 Post by buiductoan »

I try to add dicom file in to dicom dir but not sucessful. I reference some topic in forum, and realize that some people has the same proplem. I have one dicom file in C disk that name is B. But the result is

Code: Select all

"checking file C:\B No such file or dicternary : reading file B ..."
This is my code. What is error?

Code: Select all

DicomDirInterface ddir;
const char *opt_output = DEFAULT_DICOMDIR_NAME;
const char *opt_fileset = DEFAULT_FILESETID;
const char *opt_descriptor = NULL;
const char *opt_charset = DEFAULT_DESCRIPTOR_CHARSET;
const char *opt_directory = "";
const char *opt_pattern = "";
DicomDirInterface::E_ApplicationProfile opt_profile = DicomDirInterface::AP_GeneralPurpose;
OFCondition status=ddir.createNewDicomDir(opt_profile, opt_output, opt_fileset);
//= ddir.createNewDicomDir(DicomDirInterface::AP_GeneralPurpose,"C:\DICOMDIR"); 
ddir.disableBackupMode();
ddir.disableConsistencyCheck();
ddir.enableMapFilenamesMode(OFFalse);
ddir.enableIconImageMode();
ddir.disableEncodingCheck();
ddir.disableResolutionCheck();
ddir.disableTransferSyntaxCheck();
ddir.setIconSize(128);

if (status.good())
{
ddir.setFilesetDescriptor("DICOMDIR"); 
status=ddir.addDicomFile("B","C:");
if(status.good())
{
status = ddir.writeDicomDir();
}
if (status.bad())
cout << "Error: cannot write DICOMDIR (" << status.text() << ")" << endl;

} 
else
cout << "Error: cannot create DICOMDIR (" << status.text() << ")" << endl;

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

Re: Can't add dicom file in DIRDICOM?No such file or dictern

#2 Post by J. Riesmeier »

Does dcmgpdir (from the command line) work? Is there any other log output?

buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Re: Can't add dicom file in DIRDICOM?No such file or dictern

#3 Post by buiductoan »

I don't use command line, I use code to add dicom file in DIRDICOM. And this log is a result from below code. What was error in my code?

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

Re: Can't add dicom file in DIRDICOM?No such file or dictern

#4 Post by J. Riesmeier »

Yes, I know because you've provided your source code in the first posting. My question was whether dcmgpdir works with the same input files, e.g. is there really a DICOM file "C:\B"?

buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Re: Can't add dicom file in DIRDICOM?No such file or dictern

#5 Post by buiductoan »

Dear supporter, I have run sell with command.

Code: Select all

 dcmgpdir -v 001 
In the case 001 is DICOM file in same folder with dcmgpdir.exe but the result is the same result of the my code. I am using DCMTK version 3.6.1. What is happend?

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

Re: Can't add dicom file in DIRDICOM?No such file or dictern

#6 Post by J. Riesmeier »

And, what is the log output of dcmgpdir? It's really hard to get information out of you :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest