-
Notifications
You must be signed in to change notification settings - Fork 34
Broader support for AbstractArrays #144
Comments
That should be quite easy to do with my generic convert infrastructure... I will take a look at it! |
Mostly I filed this to find out whether this was intentional. If you want, feel free to close this now and address individual issues as they arise. |
Nope, not intentional ;) Just tried to keep down the complexity for a first implementation. |
Sounds like it's exactly the same set of aims that the new Images recently achieved. 👍 If you're not intimately familiar with it, the two key contributions were the incorporation of AxisArrays and the creation of a number of view types that allow you to start from basically any type of object and trivially "massage" it into the form that Images wants to work with, without copying any data. Hint: MappedArrays.jl is your friend, because it lets you do the equivalent of |
Oh, and BTW: for orientation purposes I decided to go positional rather than by Note that I'm aware of an orientation issue in NRRD that needs fixing. |
@timholy I finally got around to turn my prototype into a package: |
Before I dive into the code, can you briefly summarize for me the problem you're trying to solve? I think all the issue of naming axes are well-handled by AxisArrays, and all the issues of permuted order are well-handled by PermutedDimsArrays. They both have systematic support through the standard type system for many operations. |
Sorry, this wasn't very clear. This is not about Arrays and Images, this is about sharing documentation, conversion behaviour and attributes across generic visualization types.
In GLVisualize, my task is to extract all useful information out of a type a user gives me and transform into something a graphics backend can work with. This means, when they give me an Covering all these conversion and default creation tasks can be elegantly solved with FieldTraits. |
This is basically the answer for my need, that GLVisualize is 90% about documenting, converting, handling wrong formats, etc for all different kind of visualization attributes, which are usually shared between a lot of visualization types, but might have slightly different behaviour depending on the parent type that contains the field/attribute. This problems becomes a lot worse now that I want to offer different backends, since backends mostly duplicate behaviour but also might differ greatly depending for some field. |
OK, that makes more sense. In the modern JuliaImages, we provide views that make it easy to work with both the user-provided format and the Images-preferred format. I think that makes sense for something like an image-processing suite, where you're likely to have a whole chain of calls generated by the user and consequently it's nice to have the intermediate "standardized" format so it can be reused. For a visualization suite, in a sense once you "slurp in" the user's input, then it becomes opaque to the user, so I guess there's less motivation to expose convenient "standardization" views. I probably won't have time to check it out today, but I'll take a look ASAP. |
Great, I'm looking forward to your feedback :) Bug me if there's anything that doesn't make sense! I will try to improve the examples and README as well. |
I wrote up some more about my design and how Visualize will interact with FieldTraits in the The awesome thing is, that we can transpile this to OpenGL, being able to freely mix Julia and OpenGL :) So it will be possible to e.g. do this: volume = rand(Float32, 128, 128, 128)
visualize(volume, pathtracer = (ray, volume) -> begin # do path tracing in a julia callback on the gpu!! :-O
...
end) |
Volumetric visualization works if you pass an
Array
, but if you want to visualize a subregion then one might think thatview(vol, 100:300, ....)
should work. If the failure here isn't deliberate, then we should introduce fallbacks (even if they involve copying data to anArray
).The text was updated successfully, but these errors were encountered: