Index: trunk/Ohana/src/opihi/dvo/imextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/imextract.c	(revision 13479)
+++ trunk/Ohana/src/opihi/dvo/imextract.c	(revision 14401)
@@ -9,12 +9,17 @@
   double x, y, ra, dec, t, trange;
   time_t tzero, TimeReference;
+  SkyRegionSelection *selection;
 
   PhotCode *code;
-  Graphdata graphsky;
   Image *image;
   Vector *vec;
 
-  if (!GetGraphData (&graphsky, NULL, NULL)) return (FALSE);
   if (!InitPhotcodes ()) return (FALSE);
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
 
   /* check for time-based selection */
@@ -33,11 +38,4 @@
     remove_argument (N, &argc, argv);
     TimeSelect = TRUE;
-  }
-
-  /* check for region-based selection */
-  RegionSelect = FALSE;
-  if ((N = get_argument (argc, argv, "-region"))) {
-    remove_argument (N, &argc, argv);
-    RegionSelect = TRUE;
   }
 
@@ -104,5 +102,5 @@
 
   if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
-  image_subset (image, Nimage, &subset, &Nsubset, &graphsky, RegionSelect, tzero, trange, TimeSelect);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect);
   if ((mode == RA) || (mode == DEC)) BuildChipMatch (image, Nimage);
 
