-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring to allow adding multiple Assets (dynamic tiff sequences) #718
Conversation
data_sources=None, | ||
): | ||
@property | ||
def insert(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have factored out this bit into its own method because it's reused a couple of times throughout the class. Maybe call _insert
?
tiled/adapters/tiff.py
Outdated
arr = tifffile.TiffSequence( | ||
self._seq.files[slice_start : slice.stop : slice_step] # noqa: E203 | ||
).asarray() | ||
# NOTE: may need to force np.array type if arr is a scalar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force to be arrays
tiled/adapters/tiff.py
Outdated
""" | ||
|
||
if slice is None: | ||
if (slice is None) or (slice is Ellipsis): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove None
This PR:
(1) implements minor cosmetic refactoring in
adapter.py
; specifically, it separates the asset creation functionality into the_put_asset
method, which is called when a new data source/ node is created and when an existing data source is updated. This allows to add new assets to an exisiting data source. (Possibly more refactoring needed to improve the speed).(2) expands the
TiffSequenceAdapter
class to accept tiff files with more than 2 dimensions (e.g. color images) and also to allow implicit slicing extension to arbitrary number of adjacent dimensions with Ellipsis.