Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 9413)
+++ trunk/ippTools/src/dettool.c	(revision 9417)
@@ -1430,4 +1430,7 @@
         " JOIN detRun"
         "   ON detRun.position = detProcessedImfile.det_id"
+        " JOIN detInputExp"
+        "   ON detRun.position = detInputExp.det_id"
+        "   AND detRun.iteration = detInputExp.iteration"
         " WHERE"
         "   detRun.state = 'run'"
@@ -1438,4 +1441,17 @@
         psStringAppend(&query, " AND %s", whereClause);
         psFree(whereClause);
+    }
+
+    {
+        bool status = false;
+        bool included = psMetadataLookupBool(&status, config->args, "-included");
+        if (!status) {
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
+            return false;
+        }
+        // restrict search to included imfiles
+        if (included) {
+            psStringAppend(&query, " AND detInputExp.include = 1");
+        }
     }
 
Index: trunk/ippTools/src/dettoolConfig.c
===================================================================
--- trunk/ippTools/src/dettoolConfig.c	(revision 9413)
+++ trunk/ippTools/src/dettoolConfig.c	(revision 9417)
@@ -153,4 +153,6 @@
     psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-exp",  0,
         "restrict results to complete 'exposures'", false);
+    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-included",  0,
+        "restrict results to exposures 'includeded' in the current iteration", false);
     psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-simple",  0,
         "use the simple output format", false);
