How to import a .MAP OMNIC picta file into matlab
12 views (last 30 days)
Show older comments
Hi ,
I wanted to import a .MAP file into matlab. The map is hyperspectral data and I would like to extract the x, y coordinates for each point, and a spectrum at each point, there are around 2500 pixels. I have found nothing on the web about importing OMNIC Picta .MAP files
What code or function could I use to import and extract this data, I cannot attach the .MAP file but I can send it via email if that helps,
Thanks in advance :)
2 Comments
Subhadeep Koley
on 14 Apr 2021
@Taranvir Bedi What is the exact dimension (height, width, bands) of the data present in the .MAP file?
Answers (2)
Adam Wright
on 21 Jan 2022
Edited: Adam Wright
on 21 Jan 2022
I had a similar problem. I was not able to read the .map file directly into MATLAB, but I was able to use the Omnic Picta program that came with my Nicolet FTIR (FT-IR) microscope to export the map data to a format readable by MATLAB:
- Under ‘Analyze Spectra and Maps’, choose ‘Export’ to export the map data as an ENVI format .dat file
- To load the ENVI's binary hyperspectral image data with MATLAB we can use the 'multibandread' command, with the parameters contained in the ‘.hdr; file which is also produced during the export process
So for example, my .hdr file reads
ENVI
description = {Spectrum 1 of 100}
samples = 10
lines = 10
bands = 863
header offset = 0
data type = 4
interleave = bip
z plot titles = {Wavenumbers (cm-1), %Transmittance}
pixel size = {0.000100001, 0.000099995}
followed by a list of wavelengths. So in MATLAB, I can access the data using the following code:
precision = 'float';
headerOffset = 0;
interleave = 'bip';
byteOrder = 'ieee-le';
% Read the data
map_data = multibandread('Au 5nm map.dat',[10, 10, 863], precision, headerOffset, interleave, byteOrder);
which in this example produces map_data, a 10 x 10 x 863 matrix: 100 spectra (a the 10 x 10 points on my map grid) each containing intensities at 863 wavelengths.
Hopefully this is useful to someone else in future!
0 Comments
Subhadeep Koley
on 14 Apr 2021
As, .MAP is not a standard file format. It is difficult to provide exact solution.
However, if the .MAP file is a binary file, you can try using multibandread(_). However, in order to use multibandread(_) apart from height, width, bands, you'll also need precision, header offset, interleave value and byte order of your data.
% Specify the parameters
precision = 'double';
headerOffset = 0;
interleave = 'bsq';
byteOrder = 'ieee-le';
% Read the data
data = multibandread('yourFile.MAP',[51, 51, 432], precision, headerOffset, interleave, byteOrder);
1 Comment
Adam Wright
on 21 Jan 2022
Thanks very much for this! See my answer below: this code works if the map is first exported to a .dat file using Omnic Picta. The parameters for multibandread may be found in the .hdr file generated during export.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!