StoreScp determine filesize

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

StoreScp determine filesize

#1 Post by kattabomane »

Hello,

Using the storescp, is there anyway to determine the filesize whithout saving the file locally ?

This in order to block huge files ?

Thanks for your help.

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

Re: StoreScp determine filesize

#2 Post by J. Riesmeier »

No, this is not possible since the "file size" it not known to the SCP before the DICOM dataset has been received completely. Of course, you could modify the source code in order to reject (or just do not save) a dataset that exceeds a certain size. However, both approaches would be bad style in my humble opinion. It would be more standard conformant to decide whether to accept or reject a particular SOP instance based on the associated SOP class and transfer syntax (i.e. the presentation context proposed by the SCU).

kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

Re: StoreScp determine filesize

#3 Post by kattabomane »

Hello,
However, both approaches would be bad style in my humble opinion
I agree 100 % with you. This is not the better way to do it ! But in real case, some physician does US sequences which weighs more than 2.5 GB. These type of files crawls the storage area.
DICOM dataset has been received completely
Yes, once the complete data received and before invoking the dicomfileformat->SaveFile is there any way to determine the filesize.
Should we always write the files and calculate the file size ?
How to estimate the size of dataset before writing to local drive ?

Thanks for your help.

st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Re: StoreScp determine filesize

#4 Post by st80rules »

How to estimate the size of dataset before writing to local drive ?
AFAIK, you can use DcmDataset::getLength() to know the size of a dataset.

Post Reply

Who is online

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