GeoTiff image boundaries (lat, lon)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GeoTiff image boundaries (lat, lon)

dvor
Hi

After searching various online forums for ImageJ, I still have not found many solutions for working with georeferenced (GeoTIFF) in ImageJ.  I have written an ImageJ macro to create NDVI contour maps from georeferenced iamge mosaics, but have not found a way to preserve the georeferencing in the output images (or even just in an output text file).

I am "stuck" at trying to read the image boundaries - in terms of latitude and longitude coordinates - from a georeferenced image. I do not see (at least that I understand) such info in the GeoTIFF properties listed in the log window when Debug mode is used.

Does anyone know how to do this in ImageJ?

Dvor
Reply | Threaded
Open this post in threaded view
|

Re: GeoTiff image boundaries (lat, lon)

Marcel
If you save the image with ImageJ the georeferenced context gets lost in the *.tiff image.
I would simply use the gdal library (with command line tools) to reproject the images.

http://www.gdal.org/ 

Here is an useful example how you can do that with rgdal (extract the info and reproject):

http://gis.stackexchange.com/questions/65998/how-can-i-use-gdal-to-batch-define-a-projection

Since you are using a IJ macro you can call gdalwarp from within your macro with a native call:

http://rsb.info.nih.gov/ij/macros/ExecExamples.txt

(or convert all images with a batch procedure at the end).

I often use rgdal (http://cran.r-project.org/web/packages/rgdal/index.html) which is an easy to use R wrapper for the gdal library.

If you are interested in here i replied to an answer concerning the use of masks and reprojection with ImageJ and R within my application:

http://bio7.org/?page_id=1918

Another possibility is to use the existing java gdal wrapper, GeoTools library or maybe rewrite the *.tiff header (i found this suggestion on the mailing list - http://imagej.1557.x6.nabble.com/Adding-Text-to-TIFF-Header-td3696853.html).

But since you are using a macro the first suggestions seems to be appropriate.



Reply | Threaded
Open this post in threaded view
|

Re: GeoTiff image boundaries (lat, lon)

Marcel
In reply to this post by dvor
After reading the post again gdal_translate from rgdal could also be appropriate. Here some links:

http://lists.osgeo.org/pipermail/gdal-dev/2004-April/002416.html

http://trac.osgeo.org/gdal/wiki/FAQRaster


Reply | Threaded
Open this post in threaded view
|

GeoTiff image boundaries (lat, lon)

dvor
In reply to this post by Marcel
Hi

Thanks for the various suggestions. I will try your gdal call suggestion.

The application I use to create my GeoTiff mosaic also permits creating KML and/or World files for the image. I am reading these in as text files, and extracting the needed georeferencing information that way.

Came across your Bio7 application when looking for ways to integrate imageJ and R, and very impressed with the level of integration of R, java, imagej etc. Will probably be using it in future applications.

D