question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, 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)

snimek obrazovky porizeny 2018-02-13 15-38-27

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
prkyprkycommented, Feb 21, 2018

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.

0reactions
tboggscommented, Feb 20, 2018

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 for pci_read_spatial, pci_read_spectral. If I can’t find that soon, there should probably be an update for envi.open to raise an exception whenever the header has file 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found