File: dcmpsprt.pl

package info (click to toggle)
dcmtk 3.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 54,900 kB
  • sloc: cpp: 274,805; ansic: 47,345; makefile: 5,313; sh: 4,250; perl: 277; xml: 182; lex: 103
file content (39 lines) | stat: -rwxr-xr-x 992 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/perl
#

$program='../apps/dcmpsprt';
# set '[Database] Directory = /data/dicom-images/rsna99/results' in test.cfg for better performance
$options='-c test.cfg';
$source='/data/dicom-images/rsna99';
# this entry is only used for message output, see comment on test.cfg
$destination='/data/dicom-images/rsna99/results';
$img_ext='.img';
$pst_ext='.pres';

printf("Create hardcopy objects from images in $source\nand store results in $destination\n\n");

# first, collect a list of all files in the archive
printf("reading file list...\n");
@files = `find $source/*$img_ext -type f -print"`;

# then create a list of all files
$files_idx = 0;
for (@files)
{
  if ($_ =~ /.*\/files$/)
  {
    $files[$files_idx++] = $_; 
  }
}

printf("creating hardcopy grayscale images...\n");
for (@files)
{
  chop($_);
  if ($_ !~ /.*\/files$/)
  {
    ($basename) = ($_ =~ /$source(.*)$img_ext/);
    printf("processing: $_\n");
    `$program $options -p $source$basename$pst_ext $_`;
  }
}