Hello All,
I was wondering if it is possible to use storescp to store separate series from the same study in separate subdirectories. I know that with the -ss or -sp options, if one simulataneously sends two series within a study, all images are stored in the same study subdirectory. If one waits until a timeout (as set with the -tos option) before sending the second series, then the series will be saved in two separate study subdirectories. I was hoping to be able to send more than one series at the same time and have them go into separate subdirectories under the study subdirectory.
Thank you for your consideration.
Jeff Solomon
Storing series in separate subdirectories
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: Storing series in separate subdirectories
Hi Jeff,jsolomon wrote: I was wondering if it is possible to use storescp to store separate series from the same study in separate subdirectories. [...]
Jeff Solomon
I do something similar by running storescp with
the -xcs option:
Code: Select all
storescp ... -xcs '/path/to/script #p'
then sorts them into subdirs according to these tags (and assign
more human friendly filenames).
Bare bone example to sort files according to Patient ID (untested):
Code: Select all
#!/bin/bash
DCMDUMP=/usr/bin/dcmdump
src_dir="$1"
for file in $src_dir/*; do
if [ -f "$file" ]; then
# Extract Patient ID from file
PatientID=`$DCMDUMP +P PatientID "$file" \
| sed -e 's/^[^[]*\[//' -e 's/\].*//'`
# Do something useful with $file
dest_dir="${src_dir}"/"$PatientID"
mkdir -p "$dest_dir"
mv "$file" "$dest_dir"
fi
done
Best regards - Juergen
Who is online
Users browsing this forum: Google [Bot] and 1 guest