-
Notifications
You must be signed in to change notification settings - Fork 143
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
Handling Image traits for AxisArrays successor #815
Comments
@Tokazama Looks like there's some error here, could you please explain how this works? HasProperties(::T) where T = HasProperties(T)
...
if HasProperties(img)
@get img "spatialproperties" ["spacedirections"]
... I'd really like to give some meaningful comments, but I still don't quite understand the advantages of this over the current method, i.e., dispatching on some_function(img::AbstractArray)
some_function(img::ImageMeta) I guess we're thinking of two different usages? Is it because you want to have more fined specification on ImageMeta's properties? |
Sorry, I put that together pretty quickly. I fixed the first example to be more like what would be implemented. If we assume some_function(img::AbstractArray)
some_function(img::ImageMeta{T,N,<:AxisArray}) where {T,N} The first implements the fall back given a lack of axis names while the second has the desired implementation. If there is a new array type that defines In other words, using something like some_function(img) = some_function(HasAxes(img), img)
some_function(::HasAxes{true}, img) = _some_function(axisnames(img), img)
some_function(::HasAxes{false}, img) = default_output |
I'm not recommending this as something that should happen just because I'd personally prefer it (although I do), but because the current design of |
Personally, I also like this idea because it's more dynamic while providing the same functionality. A potential issue is the maintainability issue introduced by this, if the codes are not well-documented or organized, it would be a nightmare for others to follow up... In the meantime, I think we also need to think about making |
I think the biggest problem would really be converging on the preferred names for functions (for example Given the current state of |
This seems like a good goal. I guess the question is whether we should return |
Update on this. This https://github.com/Tokazama/AxisIndices.jl will be registered soon. It should allow us to use NamedDims.jl and the nice indexing from AxisArrays + some other nice features. If you go here https://github.com/Tokazama/NamedIndicesMeta.jl I have already written the code to make this all compatible with Julia Images (or at least ImageAxes.jl). It's passing all the pertinent tests that ImageAxes has on my computer locally, but I'm not sure it's the best place (or naming) for the final code that glues everything together. |
I'd like to gage interest and get feedback on a some developments relevant to this issue. I currently have 4 experimental modules in AxisIndices (
I'm open to any feedback but I'm specifically am concerned with the following:
|
Yes! Sorry for the slow response. The ebbs and flows of human subject research can be an unpredictable consumption of time. |
So there is a secret coup to overthrow AxisArrays (see here). I think there's a way to easily support both throughout the transition without disrupting Images.
If we use more trait based dispatch for both the axis components and the metadata components of objects then integration is as straitforward as:
We could similarly use
HasAxes
from AxisArrays to accomplish the same thing.I know this would be a fair bit of work but it would be aimed at make no changes to the actual API, functionally, or dependencies. It would just allow other packages to more easily integrate with the Image ecosystem.
If this seems acceptable I would be willing to move forward with this and make some pull requests.
The text was updated successfully, but these errors were encountered: