Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-06 - 43,50416/proc10.sai
There are 2 other files named proc10.sai in the archive. Click here to see a list.
Comment 
.REQUIRE "PUBMAC.PUB[50,32]" SOURCE!FILE
.BEGIN PREFACE
.SOSPAGING_TRUE
.SAIL_FALSE


. Comment Note: PROC10.SAI is compiled under PUB (as well as SAIL) to make
.        a listing with a table of contents for easily
.        finding the various procedures. The PUBMAC.PUB file is 
.        used.
.
.        .R PUB
.        *PROC10.LST_PROC10.SAI
.
.;
Begin "PROC10.SAI"


COMMENT


                PROC10 - 'PROCES' FOR THE PDP10
                -------------------------------


          P. LEMKIN, B. SHAPIRO, R. GORDON, L. LIPKIN


                     IMAGE PROCESSING UNIT

           DIVISION OF CANCER BIOLOGY AND DIAGNOSIS
                   NATIONAL CANCER INSTITUTE
                 NATIONAL INSTITUTES OF HEALTH
                      BETHESDA, MD 20014


                         301-496-2394


                           ABSTRACT

                           --------

	PROC10  is  an  interactive  image  processing   system
written  in  SAIL  running  on a PDP10 computer. It dynamically
creates and deletes picture, mask, boundary, boundary transform
and window data structures.  It also provides a wide  range  of
operations on and between these data structures.

OCT 14, 1976 - LEMKIN, FIXED NUMBER BUG AND ASR33 PRINT.
Oct 12, 1976 - Lemkin, fixed GAmmas and removed I2, I3.
OCTOBER 2, 1976 - LEMKIN REMOVED ALL [50,752]  REFERENCES
August 25, 1976 - lemkin,  changed HELP.
August 24, 1976 - lemkin,  major modifications.
August 17, 1976 - lemkin, fixed SEMANTICS?
Aug 6, 1976 - Lemkin, edit changes so compatible w/PROC10.HLP
Aug 4, 1976 - lemkin, fixed sense of savebox in BINTRP
July 27, 1976 - Lemkin fixed GETPIX
July 7, 1976 - Lemkin fixed PSHRINK
June 12, 1976 - Lemkin fixed PEXPAND
June 11, 1976 - Lemkin fixed PEXPAND
June 6, 1976 - Lemkin delete OSCULATING, DRAWCIRCLE in CIRCLETRANS.
May 28, 1976 - Lemkin fixed file not found on READ
May 27, 1976 - Lemkin, added additional files for PUB
May 26, 1976 - Lemkin, added NUMBER, PRINT tty, fix PSEGMENT
May 25, 1976 - Lemkin, added SEMANTICS and fixed mask i/o
May 24, 1976 - Lemkin, fixed  fixing io and seg
May 22, 1976 - Lemkin, fixed seg list to item and READsize prob
May 22, 1976 - Lemkin, fixed seg list to item and READsize prob
May 21, 1976 - Lemkin, fixed seg list to item
May 20, 1976 - Lemkin, fixed PSEGMENT rest of ppak req for pub
May 19, 1976 - Lemkin, fixed PSEGMENT
May 17, 1976 - Lemkin, added TEXTURE and sip6
April 27, 1976 - SHAPIRO AND Lemkin fixed 4012 LCS
April 21, 1976 - SHAPIRO AND Lemkin ADDED SETBOUNDARYSCALEFACTOR
April 19, 1976 - Lemkin  setup for 50,752
April 14, 1976 - Lemkin - FIXED CIRCLE MASK
April 13, 1976 - Lemkin, Shapiro new TK4023 , GTDISP LCS coords
April 12, 1976 - Lemkin, Shapiro fixed OMNI free store setup
April 10, 1976 - Lemkin fixed MOVIE/OMNI, added ADD/REMOVEMOVIEFRAME
April 3, 1976 - Lemkin  added  l!spcstructures for SPECIALs
March 31, 1976 - Lemkin  added LISTTRANSFORM, COPYSUBARCS to bintrp
March 30, 1976 - Lemkin  added TRANSFORM item type init
March 25, 1976 - Lemkin  working on making PRC work
March 24, 1976 - Lemkin broke PROC10 up
Revised March 26, 1976 - Lemkin added TRANSFORM data structures
Revised March 29, 1976 - Lemkin added BINRP calls
;
COMMENT
.<<--PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB>>
.datetitle_(DATE&" "&TIME)
.END PREFACE

The documentation for PROC10 is contained in PROC10.TXT[50,32]
REQUIRE  file  which  is  compiled into the front of PROC10.SAI
with PUB. The help file is a variant of this file and  is  also
kept on the DSK: as PROC10.HLP.
.
.REQUIRE "PROC10.TXT[50,32]" SOURCE!FILE
.
.
.SEC(Start of PROC10)
.INDEX(Start of PROC10)
.SOSPAGE_3
.;
Begin "Start of PROC10"
COMMENT
.SS(REQUIRE files)
.INDEX(REQUIRE files)
.;
Comment
"	================================
	=    R E Q U I R E             =
	================================

	The following files are required for  use  by  PROC10.
They all reside in the Image Processing Unit's common user area
"

Comment [0]
 note the following REQ's are for debugging and will be removed;
Require "ARINFO.REQ" source!file;

Comment	 [1] Permanent REQ's;
Require "DEFINE.REQ" source!file;
Require "GETABL.REQ" source!file;
Require "IO.REQ" source!file;
Require "BOUND.REQ" source!file;
	Require "DARRAY.REQ" source!file;
	Require "CVT.REQ" source!file;
Require "SYS:DISPRM.SAI" source!file;

Comment  [2] The following are the worker routines and external
variables for the
	mini-interpreters;
Require "PRCMAX.REQ" source!file;
Require "PRCINV.REQ" source!file;
Require "PRCWRK.REQ" source!file;

Comment [2.1] Special command interpreter;
Require "SINTRP.REQ" source!file;
	Require "SPAK.REQ" source!file;
	Require "SAVER.REQ" source!file;
	Require "PTYPKG.REQ" source!file;

Comment [2.2] Picture operator interpreter;
Require "PINTRP.REQ" source!file;
	Require "PPAK.REQ" source!file;
	Require "HLFTON.REQ" source!file;
		Require "GTDISP.REQ" source!file;
		Require "TK4012.REQ" source!file;
		Require "TK4023.REQ" source!file;
		Require "CROSSH.REQ" source!file;
	Require "PIXDMP.REQ" source!file;

Comment [2.3] Mask operator interpreter;
Require "MINTRP.REQ" source!file;

Comment [2.4] Boundary and arc operator interpreter;
Require "BINTRP.REQ" source!file;
	Require "LINPAK.REQ" source!file;
	Require "1DPAK.REQ" source!file;
	Require "BDISP.REQ" source!file;

COMMENT
.SEC(Procedure CMDLOOP)
.INDEX(Procedure CMDLOOP)
.;

Procedure CMDLOOP;
"----------------------------------------"
Begin "CMD"

Integer Array 
	dispbuf[1:1];

Integer
	i;


	Boolean did!operation;

#	[CMD.0] Default values for various parameters used in PROC10
	are  given  here.  The PARAMETER command may be used to
	change them;

"	set the start of the boundary free store "
	next!free!boundary_33;

"	Default the syntax printout to false"
	db_false;
	tim!switch_false;
	trm!name_"ASR33";
	scaling_0;
	npict_1;
	autoOMNInumber_false;
	setupOMNI_false;
	auto!title_true;
	terse_true;
	bnd!scale!fact_1;
	SET!TERMINAL;

"	[CMD.0.1] Set the gray scale truncation range to [0:255]"
"	also set the image size to 256x256"
	Outstr("Initializing."&crlf);
	cur!window_0;
	dmax_255;
	dmin_0;
	im!size_256;
	PINI(dmax, im!size);

"	[CMD.0.2] Set the none itemvar"
	none_CVSI("NONE",flag);
"	set the transform item init"
	a!active_NEW;
	New!Pname(a!active,"ACTIVE");
	a!transform_NEW;
	New!Pname(a!transform,"TRANSFORM");
	v!CIRCLEtransform_NEW;
	New!Pname(v!CIRCLEtransform,"CIRCLETRANSFORM");
	v!CENTFOURIERtransform_NEW;
	New!Pname(v!CENTFOURIERtransform,"CENTFOURIERTRANSFORM");
	v!FOURIERtransform_NEW;
	New!Pname(v!FOURIERtransform,"FOURIERTRANSFORM");
	v!WALSHtransform_NEW;
	New!Pname(v!WALSHtransform,"WALSHTRANSFORM");
	v!HISTtransform_NEW;
	New!Pname(v!HISTtransform,"HISTTRANSFORM");
	ARRCLR(pix!in!use,false);
	ARRCLR(cw!in!use,false);
	ARRCLR(mask!in!use,false);
	ARRCLR(bnd!in!use,false);
	ARRCLR(trn!in!use,false);

	ARRCLR(c!wind,0);

	omni!free_Phi;
	omni!active_Phi;
	For i_1 step 1 until 200 Do
		Begin "make omni free store"
		Integer p,q;
		Itemvar xxx;
		Getformat(p,q);
		Setformat(0,0);
		s_CVS(i);
		Setformat(p,q);
		xxx_New;
		PROPS(xxx)_i;
		New!Pname(xxx,s);
		Put xxx In omni!free;
		End "make omni free store";

	ARRCLR(pix!title,null);
	ARRCLR(cw!title,null);
	ARRCLR(mask!title,null);
	ARRCLR(bnd!title,null);
	ARRCLR(trn!title,null);

#	[CMD.0.3]  initialize display;
	If  equ(trm!name,"4012")
	Then
	Begin "initializing display"
	DINI(4,10,dispbuf[1],0);
	If  not DGET
		Then outstr("FAILED TO GET THE DEC-340" & crlf);
		DPORT(0,1,0,1);
		DTSCAL(0.0127);
	End "initializing display";

"	[CMD.0.4] Initialize window to full size"
	If  equ(trm!name,"4023")
		Then sampled_10
		Else sampled_8;

	outstr("Window (" & cvs(firstrow) & ":" & cvs(lastrow)
		& "," & cvs(firstcolumn) & ":" & cvs(lastcolumn) &
		")/" & cvs(sampled)&crlf);

	std!dev_0;
	ran!seed_314569;
	density!value_128;
"	[CMD.1] Command READ-EVAL loop"
	
While true Do
	Begin "Look for command and process"
	Label bad!cmd;

"	[CMD.1.1] parameters which must be initialized on every
	command call:"
	If db=2 Then db_dbsave;
	usemask_false;
	did!operation_false;

"	[CMD.1.2] Command prompt"
	While true Do
		Begin "Prompt"
		outstr("*");
		strcopy_str_UPLOWINCHWL;
		If not Equ(str,null)
			Then Done;
		End "Prompt";

"	now analyze it"
	str_ANALYZE!CMD(str, sout, sip1, sip2,
		 sip3, sip4, sip5, sip6, proj!programmer,
		 dev!name);
	If str=null
		Then 
		Goto bad!cmd;
	START!TIMER;

"	[CMD.1.3] Tests for the set of Special  commands.  Note
some  special commands may have data structure (Pi, Bi, Ti, Mi)
name arguments which must be specially handled. Thus the  extra
tests."
		If not Equ((cmd_GUESSER(str,lgl!spclcmds)),null)
		   Then
		    If (not Equ(GUESSER(cmd,l!spcstructures),null) or
			   ((GUESSER(sout,lgl!pnames)=null 
			    and GUESSER(sout,lgl!mnames)=null
			    and GUESSER(sout,lgl!tnames)=null
			    and GUESSER(sout,lgl!bnames)=null)))
			  Then 
			  Begin "do special"
			  SPCLCMD!ASSIGNMENT;
			  did!operation_true;
			  End "do special";


"	Test if get help for the special commands"
	If db=2 and not Equ(
	   (cmd_GUESSER(cmd,lgl!spclcmds)),null)
		Then SPCLCMD!ASSIGNMENT;
"	[CMD.1.4] Guess the assignment operator or  error.  Get
the command from one of the three types of assignment operators
by  priority  decoder.  Note  the  potential  problem  with the
following code and DELETE command"

	cmd_If not Equ((s_GUESSER(str,lgl!pops)),null)
	      Then s
	      Else 
	      If not Equ((s_GUESSER(str,lgl!mops)),null)
		   Then s
		   Else 
		   If not Equ((s_GUESSER(str,lgl!bops)),null)
			Then s
			Else null;

"	[CMD.1.4.1] Do assignment operation if applicable"
		If not Equ((cmd_GUESSER(str,lgl!pops)),null)
		   Then
		   If (not Equ(GUESSER(sout,lgl!pnames),null) or
			(not Equ(GUESSER(cmd,lgl!nOUTPUT!ops),
				null) 
			   and not EQU(GUESSER(sip1,lgl!pnames),
				null))
			or db=2)
			Then 
			Begin "do pix"
			PIX!ASSIGNMENT;
			did!operation_true;
			End "do pix";

		If not Equ((cmd_GUESSER(str,lgl!mops)),null)
		   Then
		   If (not Equ(GUESSER(sout,lgl!mnames),null) or
			(not Equ(GUESSER(cmd,lgl!nOUTPUT!ops),
				null) 
			  and not EQU(GUESSER(sip1,lgl!mnames),
				null))
			or db=2)
			Then 
			Begin "do mask"
			MASK!ASSIGNMENT;
			did!operation_true;
			End "do mask";

		If not Equ((cmd_GUESSER(str,lgl!bops)),null)
		   Then
		   If (not Equ(GUESSER(sout,lgl!bnames),
						null)
		   	 or (not Equ(GUESSER(sout,lgl!tnames),
						null)) or
			(not Equ(GUESSER(cmd,lgl!nOUTPUT!ops),
				null) 
		        and (not EQU(GUESSER(sip1,lgl!bnames),
				null) or 
			     not EQU(GUESSER(sip1,lgl!tnames),null) ))
			or db=2)
			Then 
			Begin "do boundary"
			BND!ASSIGNMENT;
			did!operation_true;
			End "do boundary";

"	[CMD.1.5] Now test if something was there"
bad!cmd:	If not did!operation 
			Then
			Outstr("<--THAT WAS NOT A COMMMAND" &crlf)
			Else STOP!TIMER;
	End "Look for command and process";

    End "CMD";
#	************************************************
#	*  S t a r t     o f   c o m m a n d   l o o p *
#	************************************************;
String version;

Setbreak(1,'12,'14,"INS");

version_"Version 11/14/76 - 10:26AM";
Outstr("PROC10 :"&version&" - type HELP for information."&crlf);
runtime_call(0,"MSTIME");
cputime_call(0,"RUNTIM");
CMDLOOP;
End "Start of PROC10";
End "PROC10.SAI";
COMMENT
.<<--PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB---PUB>>
.<< The following PUB additional require files will be used  to
. build the PROC10.DOC file.>>
.
.	REQUIRE "DEFINE.REQ" SOURCE!FILE
.	SEC(SAIFIX.MAC)
.
.	INDEX(SAIFIX.MAC)
.	REQUIRE "SAIFIX.MAC" SOURCE!FILE
.	REQUIRE "PRCMAX.REQ" SOURCE!FILE
.	REQUIRE "PRCINV.SAI" SOURCE!FILE
.	REQUIRE "PRCINV.REQ" SOURCE!FILE
.	REQUIRE "PRCWRK.SAI" SOURCE!FILE
.
.	REQUIRE "SINTRP.SAI" SOURCE!FILE
.		REQUIRE "SPAK.SAI" SOURCE!FILE
.		REQUIRE "SAVER.SAI" SOURCE!FILE
.		REQUIRE "PTYPKG.SAI" SOURCE!FILE
.		REQUIRE "SOLVER.SAI" SOURCE!FILE
.	REQUIRE "PINTRP.SAI" SOURCE!FILE
.		REQUIRE "PPAK.SAI" SOURCE!FILE
.		REQUIRE "HLFTON.SAI" SOURCE!FILE
.			REQUIRE "TK4012.SAI" SOURCE!FILE
.			REQUIRE "CROSSH.SAI" SOURCE!FILE
.			REQUIRE "TK4023.SAI" SOURCE!FILE
.			REQUIRE "GTDISP.SAI" SOURCE!FILE
.		REQUIRE "PIXDMP.SAI" SOURCE!FILE
.	REQUIRE "MINTRP.SAI" SOURCE!FILE
.	REQUIRE "BINTRP.SAI" SOURCE!FILE
.		REQUIRE "BDISP.SAI" SOURCE!FILE
.		REQUIRE "1DPAK.SAI" SOURCE!FILE
.		REQUIRE "LINPAK.SAI" SOURCE!FILE
.		REQUIRE "CPAK.SAI" SOURCE!FILE
.
.		SEC(ANGNRM.F4)
.		INDEX(ANGNRM.F4)
.		REQUIRE "ANGNRM.F4" SOURCE!FILE
.
.	REQUIRE "IO.SAI" SOURCE!FILE
.	REQUIRE "BOUND.SAI" SOURCE!FILE
.		REQUIRE "CVT.SAI" SOURCE!FILE
.		REQUIRE "DARRAY.SAI" SOURCE!FILE
.			REQUIRE "FORT.SAI" SOURCE!FILE
.			REQUIRE "ARINFO.SAI" SOURCE!FILE
.			REQUIRE "CVADJ.SAI" SOURCE!FILE
.		REQUIRE "GETABL.SAI" SOURCE!FILE
.STANDARD BACK
.;