StoreSCP Deleting Output Directory

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Idilkachore
Posts: 3
Joined: Thu, 2017-10-19, 16:54

StoreSCP Deleting Output Directory

#1 Post by Idilkachore »

Hello

We start StoreSCP DICOM service using the following script. The output directory is C:\Output. The studies get sorted into subdirectories using patient name within the output directory, e.g. C:\Output\TestPatient1.
"%SCPProgDir%\SCP.exe" +v --log-config "%SCPProgDir%\SCP.cfg" -aet %SCPAET% -od %SCPOutputDir% -fe .dcm %SCPPort% -sp""

If a patient directory, e.g. C:\Output\TestPatient1, is deleted and we try to resend the same (deleted) patient study from our PACS then it fails. The StoreSCP log displays the following entry:
2017-10-19 16:16:38.505 INFO: Received Store Request: MsgID 1, (CT)
2017-10-19 16:16:38.511 INFO: storing DICOM file: <filename>.dcm
2017-10-19 16:16:38.512 ERROR: cannot write DICOM file: <filename>.dcm: No such file or directory

If the patient directory is not deleted then "move to" works successfully. Even if the files within the patient directory are deleted the "move to" works.

The problem is when the patient directory is deleted from within the output directory, the study fails and above error appears in the log.

I've been unsuccessful to find a parameter, which re-creates the patient directory if it doesn't exist.
Could someone please help me with this. Which parameter do I use?

Thanks
Idil

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

Re: StoreSCP Deleting Output Directory

#2 Post by J. Riesmeier »

I checked the source code of "storescp": If the directory is deleted while storescp is running, it is not re-created (unless a different patient is sent in between).

Idilkachore
Posts: 3
Joined: Thu, 2017-10-19, 16:54

Re: StoreSCP Deleting Output Directory

#3 Post by Idilkachore »

Thanks Riesmeir. You are right that's exactly what's happening.
Is there anyway to re-create the deleted directory without sending a different patient first?
Or are there any workarounds?

Thanks

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

Re: StoreSCP Deleting Output Directory

#4 Post by J. Riesmeier »

The only "workaround" I can see would be to modify the source code of storescp accordingly (check whether the corresponding directory already exists and recreate it if needed each time a new DICOM object is received).

Idilkachore
Posts: 3
Joined: Thu, 2017-10-19, 16:54

Re: StoreSCP Deleting Output Directory

#5 Post by Idilkachore »

Thanks Riesmeier!

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

Re: StoreSCP Deleting Output Directory

#6 Post by Michael Onken »

Just something that instantly came to my mind: Some tool of yours is deleting the patient directories frequently, do I get this right? Could you modify this tool that it checks whether there is a patient with a newer modification date than the one that is to be deleted? If so, delete it, otherwise wait. Just an idea.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest