Help for CFORM

PURPOSE
  CFORM is a VICAR applications program which converts images between any
  of the recognized data formats and performs linear transformations
  on images.

EXECUTION

  CFORM  INP  OUT  PARAMS

  where INP and OUT are input and output file parameters and PARAMS are
  other parameter that are described in Tutor mode.

METHOD

  The program reads each image line into a buffer and treats the contents
  of the buffer as data of type implied by the label.  Byte data are read
  in as halfwords.  A simple linear function (stretch) is then applied to 
  these data and they are written out in the output format specified.

  If no format code is specified for OUT the following action is taken:
    1.  If input format is BYTE, then output format is HALF.
    2.  If input format is not BYTE, then output format is BYTE.
 COMPLEX DATA:

  The linear relation between IN and OUT must be qualified for complex
  data according to the following table:

       INPUT        OUTPUT       Transformation Type
      Format        Format

      non-complex   complex       OUT = (IN*SL+OF) + 0.0i
      complex       non-complex   OUT = |IN| * SL + OF
      complex       complex       OUT = IN * SL + OF
EXAMPLES

  CFORM A B (1,1,10,20) IRANGE=(10,20) ORANGE=(-20,2000) OFORM=FULL
    Data set B is fullword integer where the values have been scaled
    linearly such that 10 -> -20 and 20 -> 2000.  Only the first 10
    lines and 20 samples of A are passed to B.

  CFORM A B OFORM=HALF SO=(2,0)
    Data set B's format is a halfword integer, with each input value
    multiplied by 2.
RESTRICTIONS

 The maximum permitted line length (bytes per line) is 60,000 for BYTE
 format and 120,000 otherwise.
COGNIZANT PROGRAMMER

Written by: J. J. Lorre    18 April 1980

REVISIONS:

  1983-06 Dan Stanfill - Converted to VAX.
  1985-02 L. W. Kamp - Deleted FORMAT parameter, check for overflow in real-to-integer conversion, fixed test file.
  1988-01 Florance Moss - Put conversion factors into the label.
  2018-03-29 W. L. Bunch - Added dead code to work around gfortran optimizer bug. When compiling in 32-bits,
             the optimizer would prevent certain loops from executing. Here's an example of the dead code:

     C        This dead code (NSO is always > 0) is inserted to prevent the
     C        optimizer from breaking the incrementing of J.
     C        Current gfortran version is 4.8.5-11.el7.
     C        When gfortran is updated, this can be removed to test for a fix.
     C        Run tstcform.pdf and compare output with tstcform.log.
              if (NSO.lt.0) then
                 write(*,*) "j=",j
              endif   

Current Cognizant Programmer:  W. L. Bunch


PARAMETERS:


INP

Input file name

OUT

Output file name

SIZE

Standard VICAR size field

SL

Starting line

SS

Starting sample

NL

Number of lines

NS

Number of samples

IRANGE

Pair of numbers for performing stretch. ORANGE must also be specified.

OFORM

Output storage format.

ORANGE

Output range values for stretch. (See IRANGE.)

BINARY

Specifies that binary labels must be copied to the output

SO

(Slope,offset) for linear transformations.

See Examples:


Cognizant Programmer: