diff --git a/model_server/base/roiset.py b/model_server/base/roiset.py
index ed8f44f873d059bb5039b1970558e398ce516e25..fa622930149d185025ab8203cc75b906519e9264 100644
--- a/model_server/base/roiset.py
+++ b/model_server/base/roiset.py
@@ -414,39 +414,32 @@ class RoiSet(object):
 
         # deproject if zi is not specified
         if bbox_zi is None:
-            def _slice_zmax(r):
-                acc_raw.crop_hw(
-                    r.y0,
-                    r.x0,
-                    r.y1 - r.y0,
-                    r.x1 - r.x0
-                )
-                # TODO: use accessor.get_z_argmax
-                zmax = acc_raw.data.argmax(axis=3, keepdims=True)[:, :, 0, 0].astype('uint16')
+            dch = params.deproject_channel
+            if dch is None or dch >= acc_raw.chroma or dch < 0:
+                if acc_raw.chroma == 1:
+                    dch = 0
+                else:
+                    raise NoDeprojectChannelSpecifiedError(
+                        f'When labeling objects, either their z-coordinates or a valid deprojection channel are required.'
+                    )
+            bbox_df['zi'] = acc_raw.get_mono(dch).get_focus_vector().argmax()
         else:
             bbox_df['zi'] = bbox_zi
 
+        bbox_df['y0'] = bbox_df['y']
+        bbox_df['x0'] = bbox_df['x']
+        bbox_df['y1'] = bbox_df['y0'] + bbox_df['h']
+        bbox_df['x1'] = bbox_df['x0'] + bbox_df['w']
+
+
         df = df_insert_slices(
-            bbox_df,
+            bbox_df[['y0', 'x0', 'y1', 'x1', 'zi']],
             acc_raw.shape_dict,
-            params.get('expand_box_by', 0)
+            params.expand_box_by,
         )
 
         # TODO: don't even make binary_mask column in obj det case
 
-        # def _make_binary_mask(r):
-        #     # acc = InMemoryDataAccessor(acc_obj_ids.data == r.label)
-        #     # cropped = acc.get_mono(0, mip=True).crop_hw((r.y0, r.x0, (r.y1 - r.y0), (r.x1 - r.x0))).data_xy
-        #     return cropped
-        #
-        #
-        #
-        # df['binary_mask'] = df.apply(
-        #     _make_binary_mask,
-        #     axis=1,
-        #     result_type='reduce',
-        # )
-
         return RoiSet(acc_raw, df, params)
 
 
diff --git a/tests/base/test_roiset.py b/tests/base/test_roiset.py
index 497bcb031b909af68cb5ea3fc11c043794000d84..6a516be0e8de6cb79610c142a756499d5e106710 100644
--- a/tests/base/test_roiset.py
+++ b/tests/base/test_roiset.py
@@ -645,22 +645,25 @@ class TestRoiSetObjectDetection(unittest.TestCase):
         table = pd.DataFrame(
             regionprops_table(labels)
         ).rename(
-            columns={'bbox-0': 'y0', 'bbox-1': 'x0', 'bbox-2': 'zi', 'bbox-3': 'y1', 'bbox-4': 'x1'}
+            columns={'bbox-0': 'y', 'bbox-1': 'x', 'bbox-2': 'zi', 'bbox-3': 'y1', 'bbox-4': 'x1'}
         ).drop(
             columns=['bbox-5']
         )
-        table['w'] = table['x1'] - table['x0']
-        table['h'] = table['y1'] - table['y0']
+        table['w'] = table['x1'] - table['x']
+        table['h'] = table['y1'] - table['y']
+        bboxes = table[['y', 'x', 'h', 'w']].to_dict(orient='records')
 
 
         roiset = RoiSet.from_bounding_boxes(
             self.stack_ch_pa,
+            bboxes,
 
         )
 
         # test segments reside in bounding boxes
 
         self.assertFalse(roiset.contains_segmentation)
+        patches = roiset.get_patches_acc()
         self.assertTrue(False)
 
 class TestRoiSetPolygons(BaseTestRoiSetMonoProducts, unittest.TestCase):