HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
3 stars 1 forks source link

Understanding the orientation for joey and opendrop #184

Open EvanKirshenbaum opened 8 months ago

EvanKirshenbaum commented 8 months ago

My understanding is that with the joey board the y-axis goes from to bottom to top and in the opendrop it goes from top to bottom.

The coordinates are being converted in the map_coord() method of the BoardMonitor class before being passed to matplot lib. Therefore, for the Tkinter canvas I convert the y coordinates like so:

def get_y_coord(self, y):
   self.rows = board.max_row - board.min_row +1  
   return (self.rows -y) * self.RECT_HEIGHT     # RECT_HEIGHT = 30

This works great, the rectangles are getting drawn correctly. I verify like so: I give each pad in the PadMonitor class a unique id, and in the note_state() method I change the color of an activated pad to green by its id rather than by coordinates.

This ensures that I am activating the correct pad. If I were to do this by coordinates, the pad could still be mirrored and I could actually activate the wrong pad.

The only thing that is not correct is the wells created by _make_shape() of the WellPadMonitor class. Those are shifted down by 1 coordinate as it seems:

image

Opendrop: image

this is how it is supposed to look like:

image

If I substract 1 from each y coordinate of that shape, it looks correct:

image

What am I doing wrong?

Migrated from internal repository. Originally created by Mark Huber on Jul 01, 2022 at 5:03 PM PDT.
EvanKirshenbaum commented 8 months ago

I'm not sure that you're doing anything wrong, but you may want to put whatever adjustment you have into map_coord(), as that's supposed to be the conversion from the (lower left hand corner) of a pad to canvas coordinates.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 05, 2022 at 2:58 PM PDT.