File: dcmpsprt.pl

package info (click to toggle)
dcmtk 3.5.4-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 23,784 kB
  • ctags: 22,942
  • sloc: cpp: 165,761; ansic: 46,396; sh: 3,808; perl: 3,465; makefile: 3,097
file content (39 lines) | stat: -rwxr-xr-x 992 bytes parent folder | download | duplicates (11)
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 $_`;
  }
}