Hi all, Am following up on reading ERDAS Imagine files with PDL. I tried reading it with PDL::IO::FlexRaw but failed. I have put a sample Imagine file on my Dropbox http://dl.dropbox.com/u/3526821/r_1.img if someone else wants to give it a whirl.
Of course, I can read it well with the various utility programs provided by GDAL, however, PDL would give me better ability to do computations on parts of the data. The gdal utilities provided are fairly simplistic. As mentioned earlier, the chief interest here is to read the ERDAS file directly by PDL, if at all possible, because converting it to an intermediate format would require more tools and more steps in the processing chain. This has set me thinking -- it would be wonderful to actually have a PDL::GDAL module in the spirit of PDL::GIS::Proj and PDL::Transform::Cartography (probably, a long term effort might want to focus on bringing all the GIS-related modules under an umbrella PDL::Geo:: namespace). GDAL (http://www.gdal.org/), and its associated vector IO library OGR (http://www.gdal.org/ogr/index.html) can read and write a lot of different formats, so PDL would automagically get the same abilities. Also of interest -- I recently stumbled upon an image IO library called Bio-Formats (developed right here on my campus). It is Java-based, so I don't know if it can be embraced by PDL, but it can read many, many different scientific image formats, and write out a few standard ones. More info on Bio-Formats is at http://loci.wisc.edu/software/bio-formats On Nov 10, 2011, at 3:15 PM, Puneet Kishor wrote: > Thanks Chris, > > On Nov 10, 2011, at 3:09 PM, Chris Marshall wrote: > >> Maybe this img2tif utility is relevant? >> http://home.gdal.org/projects/imagine/hfa_index.html > > > I am already using gdal to directly read the .img files, so that is not an > issue. The reason I want to read those files in PDL is so I can do query and > analysis more than what gdal can do. For example, gdal can query the value at > a location (a specific x,y location), but I'd like to query an area (a > polygon), and create summary stats for that area. I thinking PDL can give me > more flexibility. > > >> >> Otherwise, you can cook up a way to read the files from >> the file format information (if it is available). Another possibility >> is to use another program to convert the files to something that >> is already directly readable in PDL. > > > I'd rather not. In other words, I already have ERDAS files, and can read them > directly with gdal without further manipulation. I'd rather not inject an > extra step in between. Besides the burden of an extra step, I would probably > lose information when converting it from Imagine to something like tiff. > > >> >> --Chris >> >> On Thu, Nov 10, 2011 at 3:36 PM, Puneet Kishor <[email protected]> wrote: >>> Is there a way I can read in .img files from ERDAS using PDL? >>> >>> -- >>> Puneet Kishor >>> _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
