Skip to content
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

Requesting BuildElemLeadField module in SCIRun 5. #2391

Open
hi-this-is-Taseen opened this issue Jul 12, 2022 · 12 comments
Open

Requesting BuildElemLeadField module in SCIRun 5. #2391

hi-this-is-Taseen opened this issue Jul 12, 2022 · 12 comments
Assignees
Milestone

Comments

@hi-this-is-Taseen
Copy link

Description

BuildElemLeadField module appears to exist in 4.7 but not 5. Requesting an equivalent module in SCIRun 5.

Versions

5

@dcwhite dcwhite self-assigned this Jul 13, 2022
@dcwhite dcwhite added this to the 5.0.0 milestone Jul 13, 2022
@dcwhite
Copy link
Member

dcwhite commented Jul 13, 2022

Thanks for making the issue here. I looked at the code for that module, and I have good news and bad news. The good news is there is no UI, no algorithm class, and simple inputs (matrix and field). Every line of code but one will be trivial to convert. So other than the one line I can convert this module very easily. That one line though, is the bad news, and relates to the documentation:

This module is one of the few that allows, and requires, a looped input.

SCIRun 5's network editor does not allow loops (yet)! However, there might be a solution. Recently we prototyped a set of modules that use the python interpreter to simulate looping with state variables, and that might be useful here. It will be an interesting challenge at least, and I have an example network to work with from the BioPSE package to guide me. So I've slotted this issue in the next milestone (not the current one, which will be released soon).

@hi-this-is-Taseen
Copy link
Author

hi-this-is-Taseen commented Jul 13, 2022 via email

@dcwhite
Copy link
Member

dcwhite commented Jul 13, 2022

4.7 is no longer in development, but if you sent a network and some (small) data, I could test your setup and see how to fix it in version 5 perhaps. The sample network included in 4.7 was incomplete, but it did seem to work with the looping construct (it just didn't output or visualize anything interesting). If you attach a zip file here I can investigate further.

To get some more direct help with 4.7, I am mentioning @jessdtate who is the resident v4 expert.

@hi-this-is-Taseen
Copy link
Author

hi-this-is-Taseen commented Jul 13, 2022 via email

@jessdtate
Copy link
Contributor

There is a similar example in the forward inverse toolkit, the make lead field matrix https://github.com/SCIInstitute/FwdInvToolkit/blob/master/Networks/potential-based-fem/make_lead_field_matrix.srn5. It uses some different modules but it should have the same functionality.

@jessdtate
Copy link
Contributor

we may need to rethink this module to help it fit better in our current architecture and use cases. Let's brainstorm some ideas next week.

@hi-this-is-Taseen
Copy link
Author

hi-this-is-Taseen commented Jul 21, 2022 via email

@hi-this-is-Taseen
Copy link
Author

hi-this-is-Taseen commented Jul 27, 2022 via email

@jessdtate
Copy link
Contributor

The key to the lead field matrix is that it is a linear relationship between each individual source and each observation point. It essentially consists of a concatenation of the solution to each individual source. The key points to the provided example are the getmatrixslice, which allows you to iterate through all the source points, and the collectmatrix, which concatenates the solutions into the leadfieldmatrix. Between these modules would be the same as what you would have within the loop in the BuildElemLeadField uses. I haven't had a chance to look at your network, but I will to see if I can provide more specific feedback.

@jessdtate
Copy link
Contributor

I'm having trouble accessing the files through sharepoint. Is there a way to make them more public for a short time? We can move to email if you prefer.

@hi-this-is-Taseen
Copy link
Author

hi-this-is-Taseen commented Jul 27, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants