Open ENVI file
See original GitHub issueHi, when I try open ENVI file (in .pix format) by spectral, image is broken. After loading is image defected like this. My code is really simply, but it doesnt work. Original image is aerial image. Could you please help me?
Thank you
from spectral import *
file_hdr = 'data/CASI_2017_05_18_120034.cc.dc.sl.fss.so.rc.sc.rY_g.pix.hdr'
CASI_op = envi.open(file_hdr)
CASI = CASI_op.open_memmap(writeable=True)
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
ENVI_OPEN_FILE - L3HarrisGeospatial.com
Use this procedure to open an ENVI Classic file. The value of R_FID will be the reference for accessing any information about this...
Read more >Opening ENVI file in R gives error
I'm new at using GIS with R and I'm trying to open an ENVI file containing hyperspectral data following the suggestions from this...
Read more >How to open/read an ENVI file in R
I'm new at using GIS with R and I'm trying to open an ENVI file containing hyperspectral data following the suggestions from this...
Read more >Read metadata from ENVI header file - MATLAB enviinfo
info = enviinfo( file ) reads the metadata from ENVI (Environment for Visualizing Images) header file. ... This function requires the Image Processing...
Read more >Read and Write Binary Data in ENVI Format
ENVI files are practically C-style memory-dumps as performed by readBin and writeBin functions plus separate meta-data header file. GIF file formats can also ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved this problem. Now I tried edit HDR file manualy and I changed line ‘samples’. If I change number and add + 2 then image after loading and saving by Spectral is OK. Later I will test it with more images. Thank you so much for help.
It doesn’t look like there is a fixed amount of padding per image row; otherwise, it would probably be possible to adjust the
samples
parameter of the header to display the data properly. Unfortunately, I haven’t found any documentation on how to read PCI data files. I’ll see if I can find IDL scripts forpci_read_spatial
,pci_read_spectral
. If I can’t find that soon, there should probably be an update forenvi.open
to raise an exception whenever the header hasfile type = PCI
.While the visual display is warped, it looks like you could still do spectral processing on the file by generating a mask from any of the bands, since non-image pixels are all zeros.