On Nov 19, 2011, at 11:55 PM, chm wrote: > On 11/19/2011 10:55 PM, Puneet Kishor wrote: >> .. >> >> 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 > > Maybe the Java or Java::Import module would be of > use to you here. I haven't used these modules but > the documentation look good
The Java::Import module seemed promising, but I could not install it because its dependency GCJ::Cni failed to install. Looking at its build reports, seems like it has 2 PASS vs. 340 FAIL reports http://www.cpantesters.org/distro/G/GCJ-Cni.html#GCJ-Cni-0.03 > for what you are wanting > to do... > .. My main interest is to be able to read a small basket of raster formats that I routinely stumble upon (ERDAS Imagine, Arc GRID, GeoTiff, NetCDF, perhaps a couple other) and be able to programmatically query data from them. Usually the queries are trying to find values at a location (point or polygon) or construct some derivation (histogram and other statistics). When I get a new dataset, ideally, I wouldn't have to transform it to something else in order to make it queryable, because that would add another step, more complexity, in the process. And, ideally I would have to deal with only one query tool -- PDL would serve me well because I know a little bit of Perl. If I have to keep on shuffling between Perl and Python and Java and something else, it just makes the job harder. Here is an example of something I have done -- 1. Go to http://mumbai.geology.wisc.edu/waterisotopes The page will prompt to allow you to use your location... press OK 2. A map comes up showing isotope ratios of hydrogen and oxygen. These data are in ERDAS format on my computer. I am using GDAL via MapServer to convert them into the images. 3. Click on the map to draw a small polygon; close the polygon by double-clicking. A small popup comes up showing the histograms, min, max, mean and sd of the isotopes in the polygon that you drew. To accomplish the above, I use a couple of gdal utilities called from my Perl program (my web applications are written in Perl). The output from the gdal program that calculates the statistics is written out to a file that I then parse with Perl and extract the values, convert them to JSON and send them back to the browser where the charts and the popup are constructed. Unfortunately, the gdal programs are rather general purpose, so they can only do rectangular queries. So, even if you drew a triangle on the map, you will still get the stats for the minimum bounding rect around the poly that you drew. Plus, I can't do any other analysis unless I knew C++ and rewrote the gdal programs. Converting rasters to piddles would provide a great amount of flexibility, but PDL is currently limited in the different formats it can ingest. -- Puneet Kishor _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
