USGS

Isis 2 Documentation


sfrom Documentation

sfrom - Extensive description of SFROM parameter
The purpose of this pdf is for reference only on the SFROM parameter
that is used by most ISIS programs.

The purpose of SFROM is to allow the user to specify what parts of an
input cube file are to be passed to the application program. It is a
tool to specify a "sub-area" of your cube.  This consists of specifying
a list of index values and/or ranges of index values for each dimension
(sample,line,band) of each region (core and suffix).  All examples
shown below can be used for any dimension, including suffixes.

BASIC FORMAT:
           sfrom = "ss-es(sinc):sl-el(linc):sb-eb(binc)"

  where ss    = starting sample
        es    = ending sample
        sinc  = sample increment
        sl    = starting line
        el    = ending line
        linc  = line increment
        sb    = starting band
        eb    = ending band
        binc  = band increment

EXAMPLE:

     INPUT CUBE FILE = 150 samples x 150 lines x 255 bands
  (Assuming this cube is band sequential, it also has 12 backplanes)
      (Examples of suffix selection are the very last examples)

1)  Select from input file a subcube that is 100x100x10, starting
    with sample 15, line 20 and band 60
                sfrom="15-114:20-119:60-69"

2)  Select the same 100 samples and 100 lines as above,
    but all 255 bands
                sfrom="15-114:20-119:"  (samples:lines:bands left blank)

3)  Select all 150 samples and 150 lines of input cube,
    but just bands 60-69
                sfrom="::60-69"  (samples and lines left blank)

4)  Select same area as example 1, except every-other sample, line,
    and band. (The result will actually be 50x50x5)
                sfrom="15-114(2):20-119(2):60-69(2)"

5)  Select every-other sample, every third line and every 10th band
                sfrom="(2):(3):(10)"

SPECIAL CHARACTERS:

6) * = maximum possible value of a dimension (sample,line or band)

   Select an entire cube except starting at sample 3, line 4 and
   band 5
                sfrom="3-*:4-*:5-*"


7) ~ = Exclude values or ranges enclosed by ()

    Exclude lines 3 thru 10 and bands 240 thru 255, keep all samples
               sfrom=":~(3-10):~(240-255)"

8) # = Given a starting point, a value following the # sign is the
       number of values selected

    Select 100 bands starting with band 10
          sfrom="::10#100"

    Select first 10 samples, and 10 lines starting at 25
          sfrom="1#10:25#10:"

SUFFIX SELECTION:

9) S or s = Suffix selection

     Select all lines and all samples, the first 10 bands,
     (every other band), and the first 3 backplanes
            sfrom="::1-10(2),S(1-3)"

     Select all samples, all lines, all bands, but exclude all
     backplanes
            sfrom="::S(~(1-*))"

     Select all samples, all lines, all bands, specific backplanes
     3,5,7,8,10,12 (excluding 9 and 11)
            sfrom="::s(3,5,7-12~(9,11))"

10) If a subcube specification is very complex or is to be used
    a repeated number of times, then the specification can be
    written to a text file, such as subspec.txt.
            sfrom=""


ParmDescriptionDefault
SFROM
Input subcube specifier
--

ADDITIONAL NOTES:

ParmDescription
SFROM
SFROM specifies the subcube using a single string for all
three dimensions of the cube.  The order of the three
dimensions is always "samples:lines:bands".
If a dimension is left blank, all the data for that
dimension is selected.  The default value of NULL for SFROM
selects the entire cube.

Any application below can be used for any dimension.
To select specific data from any dimension:
  "10-100(3):11,12,15-20:1-10(2)"
This example will select every third sample starting with
sample 10 thru 100. It selects lines 11 and 12, and 15-20.
It selects every other band, starting with band 1 thru 10.

There are special characters that can be used for
selecting a subcube efficiently, such as "*","#", and "~".
For examples type: help sfrom in TAE.

**NOTE** For more examples and explanation of the many
features of the SFROM parameter, refer to Introduction
to ISIS, Section 6, of the ISIS User's Manual.

Last updated: Jan 31 2005
File: pdfs2.html

Contact us online at the Isis Support Center: http://isisdist.wr.usgs.gov

ISIS Documentation Home Page