code: public static RegionMap getRegionParamsFromImageMosaicReader( ImageMosaicReader reader ) throws IOException {
          RegionMap envelopeParams = new RegionMap();
  
          Envelope envelope = reader.getOriginalEnvelope();
  
          DirectPosition lowerCorner = envelope.getLowerCorner();
          double[] westSouth = lowerCorner.getCoordinate();
          DirectPosition upperCorner = envelope.getUpperCorner();
          double[] eastNorth = upperCorner.getCoordinate();
  
          GridEnvelope2D gridRange = (GridEnvelope2D) reader.getOriginalGridRange();
          int height = gridRange.height;
          int width = gridRange.width;
          double[][] resolutionLevels = reader.getResolutionLevels();
          double xRes = resolutionLevels[0][0];
          double yRes = resolutionLevels[0][1];
  
          envelopeParams.put(NORTH, eastNorth[1]);
          envelopeParams.put(SOUTH, westSouth[1]);
          envelopeParams.put(WEST, westSouth[0]);
          envelopeParams.put(EAST, eastNorth[0]);
          envelopeParams.put(XRES, xRes);
          envelopeParams.put(YRES, yRes);
          envelopeParams.put(ROWS, (double) height);
          envelopeParams.put(COLS, (double) width);
  
          return envelopeParams;
      }
docs: Get the parameters of the region covered by the {@link ImageMosaicReader}.
  
  @param reader the ImageMosaicReader.
  @return the {@link HashMap map} of parameters. ( {@link #NORTH} and the
  other static vars can be used to retrieve them.