Hi Chris -
Taylor has been working on creating 3D versions of our parametric shapes (see example attached). Is it possible to present such 3D stimuli in MWorks and rotate them around (with keyboard commands or otherwise) to test neuronal responses to them?
This is not an immediate project - but I could imagine looking into this further this fall?
Thanks!
Yasmine
shape13_3D.stl.zip (3.7 MB)
Hi Yasmine,
This is something MWorks could support. It will require a new stimulus plugin – something that can read and render STL files and/or other 3D model formats. I certainly think that would be a worthwhile addition to MWorks’ toolkit.
If you decide to go ahead with this, can you let me know what your timeline is? I’m guessing it would take a couple weeks to get an initial version of the plugin working.
Cheers,
Chris
Hi Chris -
Thanks for writing - and good to know MWorks might be capable of supporting this direction.
Let me take some time (a few weeks?) to think about some potential research directions related to these 3D stimuli. If I can convince myself that we have something good, I’ll let you know and we can discuss a potential plugin. We definitely have several other projects on our plate right now…so I doubt we would need a working plugin anytime soon.
Cheers,
Yasmine
Hi Chris -
Now that we’ve had a little time to think and discuss, I say lets go ahead with trying using STLs of 3D shapes in Mworks!
Ideally, we would be able to rotate these around with different key presses?
Having a version to test in late June or early July would be great - but we’re also happy to work with you on a more reasonable timeline!
Cheers,
Yasmine
Hi Yasmine,
Ok, sounds good. Late July or early August might be more realistic, but I’ll see what I can do.
When you have a chance, can you send me one of your STL files, so that I can test with it?
Thanks,
Chris
Attachments available until Jul 14, 2024
Hi Chris,
The following attachment is our most convex shape (“Shape1_3D"). Please let me know if you have trouble opening or viewing.
I’ve also attached our most concave shape (“Shape13_3D") in case you would like to see how different they are. Thank you!
Best,
Taylor
Click to Download
Shape1_3D.stl
23.8 MB
Click to Download
Shape13_3D.stl
9.3 MB
Hi Yasmine & Taylor,
I’m mostly done with the initial version of the “3-D parametric shape” stimulus, and I need your input on a question that’s come up:
When rendering the stimulus, it’s important to know the center and size of the coordinate grid containing the shape’s vertices. While it’s easy for MWorks to pick default values based on the shape’s bounding box, there will probably be times when you need to specify these parameters explicitly – for example, if the point around which you want to rotate the shape is different from the center of the bounding box, or if you want to present different shapes with the same on-screen center and size scale.
For the 2-D parametric shape stimulus, we addressed similar needs by adding parameters that set the center and edge length of the square coordinate grid. Does this seem like a good approach for 3-D shapes, too, with the coordinate grid now being a cube?
My main concern is how easy it is for you to know/discover the range of the vertices you’re using in your shapes. If you’re generating the shapes programmatically (e.g. via a MATLAB or Python script), it should be no problem. On the other hand, if you’re using a 3-D illustration program, the numeric values of the generated vertices may be harder to find.
Please let me know what you think.
Thanks,
Chris
Hi Chris -
Sorry for the delay. Was away at a conference. Will check in with the lab and get back to you very soon!
Many thanks!
Yasmine
Hi Chris
I checked with Ahmad and Taylor in the lab about this. FYI - Ahmad will tackle logistics for integrating 3D shapes in Mworks.
So far, for our 2D shapes, we’ve been hard-coding the “stimulus_vertex_range” as 4 (based on the Matlab-based control points for our stimuli which go from -2:2). We do this as follows:
var stimulus_vertex_range = 4
stimulus/parametric_shape target_para_stimulus(
alpha_multiplier = 1
vertices = shape_list[stimulus_id-1]
color = stimulus_color_r, stimulus_color_g, stimulus_color_b
x_size = stimulus_size
vertex_coord_range = stimulus_vertex_range
use_antialiasing = true
margin_pixels = 1
max_size_x = 20
max_size_y = 20
rotation = stimulus_rotation
x_position = stimulus_x; y_position = stimulus_y
deferred = yes)
Here are my current thoughts:
- For the 3D shapes, as you suggested, we could continue to do exactly the same for any stimulus set for which the experimenter knows the expected vertex range (eg stimuli generated in Matlab).
- For other STLs, I’m wondering if we define a vertex range that is very large (e.g 1000)? I think that’s what I did many years ago as a postdoc to maintain the center constant. Basically we defined an “artboard” that was infinitely large and centered on the middle of the shape. Perhaps another alternative is to define the vertex range based on screen size and have an optional scaling factor to scale things down? Not sure - but putting that thought out there!
Thoughts?
Yasmine
Hi Yasmine,
For other STLs, I’m wondering if we define a vertex range that is very large (e.g 1000)? I think that’s what I did many years ago as a postdoc to maintain the center constant. Basically we defined an “artboard” that was infinitely large and centered on the middle of the shape.
I don’t understand how that would help. The position of the shape’s center (in its own vertex coordinate grid) is part of the information MWorks needs. As I said previously, it’s easy to infer the range and center of the shape’s vertices from its bounding box. But if you want to rotate the shape around a point other than the bounding box’s center, you need to tell MWorks what that point is.
At the moment, I can’t think of a better approach than what we did for 2-D shapes, so maybe I’ll just implement that. Once you start testing the plugin, you can see how it works in practice. Perhaps a better approach will suggest itself then.
Thanks,
Chris
Sounds good. Lets try it out and see how far we get.
Thanks!
Yasmine
Hi Yasmine & Taylor,
The initial version of the 3D model stimulus is now in the MWorks nightly build.
I’ve attached an example that demonstrates how it works, using one of the STL files that Taylor provided. The comments in the experiment explain what all the parameters do.
When you have a chance, please try this out and let me know what you think. (I will send an invitation to Ahmad to join this discussion, too.)
Thanks,
Chris
3d_shapes.zip (3.7 MB)
Hi Chris -
Thanks for sharing.
Ccing Ahmad here who will test this plugin out with some help from Taylor.
Things are a bit busy before SfN but hopefully we’ll get back to you sometime this month!
Cheers,
Yasmine