-
Notifications
You must be signed in to change notification settings - Fork 1
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
Interop/testing #2
Comments
That would be great! Probably the easiest first step is getting |
That should be a one-liner ;) |
That's largely the goal with interoperability here. There will always be more that package authors can do to take advantage of |
Ok, getting my head around the traits here. Most of these seem useful and possible to integrate in DimensionalData.jl. But I have some thoughts and questions!
|
That's that basic idea, but the focus is really on the traits here. I've definitely considered other traits that are less focused on cartesian grids, but I figured we should start with the obvious. What other objects did you have in mind?
That's a good point. What
I've gone back and forth on this one a lot. Even if you have a fixed step size, subsets of that array can easily disrupt this. I think the default is to just return
Could you give a more concrete example of this. I think I understand but I want to make sure that I actually address this before I start spouting off ideas.
The design is very similar to ImageCore.jl and ImageAxes.jl in its current form. Basically everything is considered "spatial" except for time dimensions. The difference here is that we have this line and you can explicitly say a dimension name is not spatial. I had a macro where you could do
I'd be open to that. I've also considered
|
I just meant dispatch on the array as constructed object
I think the spatial/temporal difference is fine, but I would hesitate from using
Spatial data such as geotiff can distinguish between the pixels representing the mean over an interval or the value at a single point. One consequence of this is a DimensionalData.jl Another example for both the last points is that netcdf even has a format where the start and end of every interval is specified explicitly in a 2 row matrix, that may or may not be regularly spaced and contiguous. |
It's pretty common to have the same issue in brain imaging where an index could refer to any of the 8 corners, the center, or the entirety of a voxel. This isn't an issue if you have a common coordinate system though. Maybe coordinate space traits would be helpful? I'm not really sure if there's much you can do for irregularly spacing, except through an error when trying to get something like the step size. |
Interesting you have the same issue. DD has traits to handle that - Locus of Start, Center and End for each axis takes care of any combination.
Can you explain this a little more? How would this solve the I've tried not to convert to common formats eagerly in DD as users may want to save exact copies of e.g tiff or netcdf without conversion error of the coordinates, and also so that everything is lazy as it may not even be used. |
I'm going to use
The step size and length are the same for each of these but the initial offsets are 0, 1, and 2 (respectively). If you want the data at point 2 you can only really get that for the centered position. And if the had the same keys but different pixel/voxel locations such as ...
The locations represented would actually be 1:5, 0:4, and -1:3. If I understand the problem you're describing correctly, then the issue is that if you wanted to average all positions at the real world location In neuroscience we're at the mercy of whoever has created the machine that collects the data and the technician that operates it. |
Yep, pretty much. In spatial data those points are fixed e.g. lat/lon on the earths surface, as defined in some coordinate system. As it's always the same earth, not different brains, they need to be accurately comparable to a file in a different format that may use a different start/center/end position. This might amount to e.g. many kilometers of error, and may lead to selecting array subsets of different sizes/spatial extents with the same command, depending on the file format. Another thing I hadn't got my head around is your examples imply that |
Sorry for the severe delay in response.
To be clear I don't think this isn't an issue. I'm just explaining why my intuition is telling me this sort of thing isn't a dimension-wise trait and is more of a global coordinate space specification. I still need to think about that sort of thing though. I'm open to different solutions if there is a clear way to integrate it here though.
This actually originated from a conversation with @mcabbott. I don't have access to that conversation anymore, but |
Ok no problem, we can keep this conversation going as points/intervals questions come up. And I agree AxisArrays.jl has its own |
I haven't read this closely, but on terminology: I think |
Ok interesting. I've avoided overloading base methods in DimensionalData for roughly these reasons. Its good if spatial/named arrays behave for most general purposes as generic
|
I would argue here that NamedDims has taken the lead, and terms those "dimension names". Base uses
My opinion is that value wants to be what's really in the array, like
It seems less confusing to me to abuse syntax than words. Nobody actually calls |
Thanks for chiming in @mcabbott. |
* is_time -> is_temporal: b/c the package is called SpatioTemporalTraits * Removed direct reference to axes and keys for public functions. This comment worked on me for a while. The goal is to have sensible defaults that may be overloaded elsewhere. So it won't always make sense to have spatial_keys, but spatial_indices will make sense whether working with an array, plot, or mesh. * All things should be inferable now. * Given the conversation in Interop/testing #2, onset is now time_first and time_end was changed to time_last for symmetry. Also spatial_offset is now spatial_first. The short of the conversation is that the onset and offset are terms that may be interpreted differently depending on whether the first time point/spatial index coincide with the exact location of corresponding values or are off center from it as a reference. * A very minimal set of metadata options are thrown in there right now. Mostly as a starting point and not a final design decision.
If you want another test case I'd like to implement this interface in DimensionalData.jl, and eventually use it in DynamicGrids.jl to support more kinds of spatial/temporal arrays.
Is it ready for that? I could start with a branch in DD.
The text was updated successfully, but these errors were encountered: