~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/proc/replace.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)replace.prg       19.1 (ES0-DMD) 02/25/03 14:09:00
 
2
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! MIDAS procedure  replace.prg  to implement REPLACE/IMAGE, /POLYGON
 
5
! K. Banse      901023, 920109, 920401
 
6
!
 
7
! use via REPLACE/IMAGE inframe outframe test/lo,hi=repla
 
8
!         inframe = input image
 
9
!         outframe = output image
 
10
!         test = test image 
 
11
!         low,hi = real intensity interval for replacement
 
12
!         repla = constant or
 
13
!                 second input image or
 
14
!                 second input image 'op' constant
 
15
!
 
16
!         REPLACE/POLYGON in,intable out test/lo,hi=repla
 
17
!         in = input image 
 
18
!         intable = optional table with subimages of 'in'
 
19
!         test = test image 
 
20
!         out = output image
 
21
!         low,hi = real low + high threshold for polygon detection
 
22
!         repla = constant or second input image
 
23
!
 
24
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
25
!
 
26
crossref in out test
 
27
 
28
define/param p2 ? IMA "Enter output image: "
 
29
 
30
if mid$cmnd(11:11) .eq. "I" then
 
31
   !
 
32
   ! REPLACE/IMAGE
 
33
   !
 
34
   define/param p1 ? IMA "Enter input image: "
 
35
   define/param p3 ? C "Enter replacement specs: "
 
36
   write/keyw in_a {p1}
 
37
   if p2(1:1) .eq. "+" then
 
38
      write/keyw out_a {p1}                     !output = input frame
 
39
   else
 
40
      write/keyw out_a {p2}
 
41
   endif
 
42
   write/keyw history "REPLACE/IMAGE "
 
43
   define/maxpar 3
 
44
   run MID_EXE:REPLA
 
45
else
 
46
   !
 
47
   ! REPLACE/POLYGON
 
48
   !
 
49
   define/local itab/i/1/1 0                    !look for input table
 
50
   itab = m$index(p1,",")
 
51
   if itab .gt. 1 then
 
52
      itab = itab-1
 
53
      write/keyw in_a {p1(1:{itab})}
 
54
      itab = itab+2
 
55
      write/keyw inputc {p1({itab}:>)}
 
56
   else
 
57
      write/keyw in_a {p1}
 
58
      write/keyw inputc +
 
59
   endif
 
60
   write/keyw out_a {p2}
 
61
   !
 
62
   itab = m$index(p3,"/")
 
63
   if itab .gt. 0 then
 
64
      itab = itab-1
 
65
      write/keyw in_b {p3(1:{itab})}
 
66
      itab = itab+2
 
67
      write/keyw p4 {p3({itab}:>)}              !fill P4 correctly
 
68
   else
 
69
      write/keyw in_b {in_a}                    !test frame = inframe
 
70
      write/keyw p4 {p3}
 
71
   endif
 
72
   !
 
73
   action(1:2) = "PO"
 
74
   write/keyw history "REPLACE/POLYGON "
 
75
   define/maxpar 3
 
76
   run MID_EXE:GENZZ1
 
77
endif