Skip to content

adjustments to pipette positioning utils to support rotated plates#441

Closed
ben-ray wants to merge 2 commits intoPyLabRobot:mainfrom
ben-ray:ray/stepofffoil_adjustments
Closed

adjustments to pipette positioning utils to support rotated plates#441
ben-ray wants to merge 2 commits intoPyLabRobot:mainfrom
ben-ray:ray/stepofffoil_adjustments

Conversation

@ben-ray
Copy link
Contributor

@ben-ray ben-ray commented Mar 19, 2025

this is tested to work fine on both 90deg rotated plates & non-rotated plates, but might move the exact location of the pips from before

Comment on lines 72 to 82
# offsets are in absolute space.
if resource.get_absolute_rotation().z % 180 == 0:
min_y = (resource.get_size_y() - channel_space) / 2
min_y = (resource.get_absolute_size_y() - channel_space) / 2
if min_y < min_spacing_edge:
raise ValueError("Resource is too small to space channels.")
offsets = [
Coordinate(0, min_y + i * min_spacing_between_channels, 0) for i in range(num_channels)
][::-1]
elif resource.get_absolute_rotation().z % 90 == 0:
min_x = (resource.get_size_x() - channel_space) / 2
min_x = (resource.get_absolute_size_x() - channel_space) / 2
offsets = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it work with just resource.get_absolute_size_y? why is the special %90 case necessary?

Comment on lines 50 to +59
center_offsets = [Coordinate(x=x_offset, y=c, z=0) for c in centers]
offsets_relative_to_center = [c - resource.center() for c in center_offsets]
elif resource.get_absolute_rotation().z % 90 == 0:
y_offset = resource.get_size_y() / 2
center_offsets = [Coordinate(x=c, y=y_offset, z=0) for c in centers]
x_offset = resource.get_absolute_size_x() / 2
center_offsets = [Coordinate(x=x_offset, y=c, z=0) for c in centers]
offsets_relative_to_center = [c - resource.center() for c in center_offsets]

# offsets are relative to the center of the resource, but above we computed them wrt lfb
# so we need to subtract the center of the resource
return [c - resource.center() for c in center_offsets]
return offsets_relative_to_center
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectively nothing changed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, we no longer need the %90 case when using get_absolute_size_x

Comment on lines -14 to +17
return [(i + 1) * dim_size / (n + 1) for i in range(n)]
start = margin
end = dim_size - margin
step = (end - start) / (n - 1) if n > 1 else 0
return [start + i * step for i in range(n)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there is enough space in this case, we would rather space the channels equally than putting side channels exactly at the margin. margin is meant to be a minimum margin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I can define margin, I expect channels to go narrower when I input a higher margin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can instead change the well definition for the same effect, but then the well definition is no longer accurate

Copy link
Member

@rickwierenga rickwierenga Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they should not go narrower than margin in any case

@ben-ray ben-ray closed this Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants