Index: trunk/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- trunk/Ohana/src/kapa2/include/prototypes.h	(revision 14499)
+++ trunk/Ohana/src/kapa2/include/prototypes.h	(revision 14500)
@@ -67,4 +67,7 @@
 int           SetImageData        PROTO((int sock));
 int           GetImageData        PROTO((int sock));
+int           SetImageCoords      PROTO((int sock));
+int           GetImageCoords      PROTO((int sock));
+int           GetImageRange       PROTO((int sock));
 
 int           LoadVectorData      PROTO((int sock, KapaGraphWidget *graph, int N, char *type));
Index: trunk/Ohana/src/kapa2/src/CheckPipe.c
===================================================================
--- trunk/Ohana/src/kapa2/src/CheckPipe.c	(revision 14499)
+++ trunk/Ohana/src/kapa2/src/CheckPipe.c	(revision 14500)
@@ -155,4 +155,22 @@
   }
   
+  if (!strcmp (word, "SIMC")) {
+    SetImageCoords (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GIMC")) {
+    GetImageCoords (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GIMR")) {
+    GetImageRange (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
   if (!strcmp (word, "GIMD")) {
     GetImageData (sock);
Index: trunk/Ohana/src/kapa2/src/SetImageData.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 14499)
+++ trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 14500)
@@ -52,2 +52,87 @@
   return (TRUE);
 }
+
+int SetImageCoords (int sock) {
+  
+  int i;
+  double xmin, xmax, ymin, ymax;
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+  
+  KiiScanMessage (sock, "%f %f %f %f", 
+		  &image[0].coords.pc1_1, &image[0].coords.pc2_2,
+		  &image[0].coords.pc1_2, &image[0].coords.pc2_1);
+
+  KiiScanMessage (sock, "%s", image[0].coords.ctype);
+
+  KiiScanMessage (sock, "%lf %lf %f %f %f %f", 
+		  &image[0].coords.crval1,
+		  &image[0].coords.crval2,
+		  &image[0].coords.crpix1,
+		  &image[0].coords.crpix2,
+		  &image[0].coords.cdelt1,
+		  &image[0].coords.cdelt2);
+
+  return (TRUE);  
+}
+
+int GetImageCoords (int sock) {
+  
+  Section *section;
+  KapaImageWidget *image;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  KiiSendMessage (sock, "%g %g %g %g", 
+		  image[0].coords.pc1_1, image[0].coords.pc2_2,
+		  image[0].coords.pc1_2, image[0].coords.pc2_1);
+
+  KiiSendMessage (sock, "%s", image[0].coords.ctype);
+
+  KiiSendMessage (sock, "%g %g %g %g %g %g", 
+		  image[0].coords.crval1,
+		  image[0].coords.crval2,
+		  image[0].coords.crpix1,
+		  image[0].coords.crpix2,
+		  image[0].coords.cdelt1,
+		  image[0].coords.cdelt2);
+
+  return (TRUE);
+}
+
+int GetImageRange (int sock) {
+  
+  Section *section;
+  KapaImageWidget *image;
+  double Xmin, Xmax, Ymin, Ymax;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  Screen_to_Image (&Xmin, &Ymin, 0.0, 0.0, image);
+  Screen_to_Image (&Xmax, &Ymax, image[0].picture.dx, image[0].picture.dy, image);
+
+  KiiSendMessage (sock, "%g %g %g %g", Xmin, Xmax, Ymin, Ymax);
+
+  return (TRUE);
+}
+
Index: trunk/Ohana/src/kapa2/src/SetImageSize.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetImageSize.c	(revision 14499)
+++ trunk/Ohana/src/kapa2/src/SetImageSize.c	(revision 14500)
@@ -77,4 +77,5 @@
       image[0].text_dx = ZOOM_X;
       image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
 
       image[0].overlay_button[0].x = image[0].text_x;
@@ -144,4 +145,5 @@
       image[0].text_dx = ZOOM_X;
       image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
 
       image[0].overlay_button[0].x = image[0].text_x;
@@ -209,4 +211,5 @@
       image[0].text_dx = ZOOM_X;
       image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
 
       image[0].overlay_button[0].x = image[0].text_x;
@@ -274,4 +277,5 @@
       image[0].text_dx = ZOOM_X;
       image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
 
       image[0].overlay_button[0].x = image[0].text_x;
