X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



12515 Rate this article:
3.0

How to start ENVI on Linux with a specific file open and displayed

Sometimes it's handy to be able to launch ENVI while specifying a particular image file to open and display. There are a few different ways to do this on a Linux platform, depending on which ENVI application you are running, and exactly how you want it to work.

For ENVI 5.0+:

From a terminal window, you can issue the following command:

     envi -arg '<filepath and name>'

. . . where <filepath and name> is the full path and filename for the image file you wish to open an display when you launch ENVI. So, for example, if you want to launch ENVI with the qb_boulder_msi image that comes with an ENVI installation opened and displayed, you would use this following command (assuming that ENVI is installed in the typical location):

     envi -arg '/usr/local/exelis/envi52/data/qb_boulder_msi'

Note that the main ENVI interface automatically tries to figure out which bands you want to display, using internal logic based on characteristics of the image. If ENVI cannot determine which bands you probably want to display (for example, if it is a hyperspectral image), then the image will be opened, but not displayed.

For ENVI Classic:

The most common way to launch ENVI Classic while specifying an image file to open upon launch is to use a startup script. If you look in the ENVI Classic Help system under Getting Started with ENVI > Basics of Working With ENVI > Starting and Exiting ENVI > Using Startup Scripts, you will find an example that opens and loads an image when starting up ENVI.

Another option is to use the following steps:

1. Write some IDL code like the following:

;Start ENVI

envi

;Save the file you specified at the command line as the variable "file"

file=command_line_args()

;Open the specified file in ENVI

envi_open_file, file[0], r_fid=fid

;Display band 1 of the specified file in a grayscale display 

envi_display_bands, [fid], [0], /new

In this example, ENVI will display the first band of the specified file in a grayscale display. If you want something else, you will need to adjust the code to specify which bands to display, using the ENVI_DISPLAY_BANDS routine.

2. Save the code into a file called mylaunch.pro. Remember the full path to the location in which you save this file.

3. Start ENVI using a command something like this:

     idl '<path>/mylaunch.pro' -args '<path and name of file to open>'

For example, to open the qb_boulder_msi file mentioned earlier, I might issue a command like this:

     idl '/usr/shippert/code/mylaunch.pro' -args'/usr/local/exelis/envi52/data/qb_boulder_msi'

 

 

PS 4/6/2015; reviewed KK 4/6/2015

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »