-
Notifications
You must be signed in to change notification settings - Fork 272
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
MR FIX legacy data #241
MR FIX legacy data #241
Conversation
I'm a bit confused. Is this functionality already in |
No, this is not in 4.7.0. There was a "bugfix" for identifying problem runs and rerunning them with 1 volume wishart, but it did not include these additional options. |
Have you done any testing already? We should test with |
I have done some testing on HCP-style and legacy-style data, with the recommended settings (hp=0, and hp=-1 during the concatenated section). I didn't test polynomial detrending. |
Can we test |
I have tested hp 2000 and pd2, and didn't see any error messages. |
@mharms I have made edits to the comments which should resolve the discussions. Please check them and say whether you are happy with the PR now. |
@glasserm any comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main thing missing here is the --legacy flag to trigger the legacy behavior and the --processing-mode=(HCPStyleData|LegacyStyleData)] stuff that the other scripts with legacy options have. I don't think we want legacy mode users to have to figure out what things like volWisharts, ciftiWisharts, or icadimMode mean. Such users are already unlikely to be super comfortable with the HCP Pipelines, so we need to keep things simple. Those are fine as expert flags for someone like Takuya or me, but are not a good thing to expose to the typical user.
We wanted to be able to change the wisharts for other purposes, which is why I made them options. Having more than one option that changes the wisharts would create problems with precedence, and hide additional sets of defaults in the code. This is why I suggested a config file to contain the "legacy" settings (config handling is already built into the new options library), to simplify the three arguments into one, without creating new problems. That would require converting ReApply to newopts, but it would also allow the possibility for hcp_fix_multi_run to pass more of its arguments to ReApply... via a config file saved into the subject dir while running, rather than needing to be copied manually into the ReApply batch file. Regardless, "--legacy" is not a good option name for triggering this functionality, since we established there could be data other than legacy-style that would benefit from it, and it isn't clear from the name what aspect of the processing it changes. A "--fix-mode=legacy" option might be a better way to name it, allowing easy extension to an NHP mode. But, of course, using the config functionality would allow new settings without editing the code itself. I don't see a reason not to use a config file for this, unless we specifically want the wishart settings and other details to not be exposed in the usage (and not allow users to use other combinations without editing the code). I am not as clear whether this processing mode has drawbacks considerable enough to disable it without the "legacy-style" processing mode. One end of the scale is slice timing interpolation, which interferes with motion correction. It also raises the question of what settings for the wisharts should require the processing mode check. |
@coalsont nicely articulates the unease I was feeling about automatically triggering these new features as part of the other "legacy"-style code. |
I think even with Matt's idea, there would be separate "--processing-mode=legacy" to enable, and "--fix-mode=legacy" or similar options to actually change the mode. Config files to contain the groups of settings, rather than writing them into the code, just seems more maintainable and appropriate to me. |
I don't think melodiclike prevents fitting multiple wisharts, though the "half spectrum" noise estimate may not be good enough for stable results. |
Isn't the point of the fitting to determine the dimensionality? If so, then if |
I think it is true that melodic doesn't fit multiple wisharts. That may be an unimportant detail, and the actual effect of the setting is described in the help info. |
You wouldn't use multiple Wisharts with melodiclike, so that can be an error. Melodic uses a fixed number of eigenvalues to do variance normalization from the rest, that is why this is melodiclike. |
I was perhaps conflating the estimate of the dimensionality for the VN (which apparently |
|
Thanks @glasserm. That's helpful additional context in your comment above. One other thing might be worth commenting on here (or even including as a comment in |
Co-authored-by: Michael Harms <[email protected]>
I've asked Alex to put that in his paper. I did an OHBM abstract on it in 2020. |
Since the VN step is orthogonal to the wishart modeling step, I don't see a reason to make it an error to combine them in a way we aren't currently expecting. A warning makes sense for combinations that we expect to be suboptimal, but haven't had a reason to try. We already print a bunch of stuff just for enabling the option anyway. At present, warnings are printed to stdout, with just the addition of the word "WARNING". Do we want to stick with that, or have all warnings go to stderr? We could even test if stderr is a tty, and if not, log to both stderr and stdout. |
On the other hand, maybe the point is that we want to warn users that what we call "melodiclike" is intended for low timepoints, and could check the number of timepoints against some threshold (300?) and warn the user that default mode should work better. This could also suggest that the mode should be named something like "fewtimepoints". |
I don't know exactly how many timepoints is too few. The HCP-YA Emotion task was 176 timepoints and lasted 2.1 minutes and works fine. The legacy data had 90 timepoints and lasted 4.5 minutes and didn't work. There may be an interaction between slow TR and few timepoints as well. |
Warnings could go to both stderr and stdout if not a tty. |
I'm fine with either |
For unixlike tools where the stdout is likely to be parsed by some other command, warnings (and any other stuff besides the parseable output) should absolutely go to stderr. For other tools, stderr is for things you want to make extra sure the user sees (if they redirect just stdout to a file, stderr will still show up in the terminal), so stderr is still a good place for warnings (as long as warnings aren't overused for minor things). I didn't remember it, but yes our log functions already did put errors into both stderr and stdout, if stderr wasn't a tty, but left warnings on stdout. Checking whether stdout and stderr go to the same place might be better, but I don't know if there is an easy way to do that. To be clear, I am suggesting changing the shlib so all warnings in all pipelines would get printed to the same place(s) as errors. |
I don't have a strong opinion. It would probably elevate the likelihood that warnings would be seen, but would also mean that a non-empty stderr file is no longer a sign of a error per se (i.e., the stderr file may be non-empty, even though the processing completed). |
If we output a warning from the pipelines, it is generally serious enough that it should be looked at as if it could be an error, right? Hopefully no tools are specifically using log file sizes as a completion check. Yes, that would suggest that at present, qunex logs that have a pipelines-produced error have the message printed twice in the log. I don't see this as a significant problem, given the technical challenge of avoiding it (versus the more important feature of showing it in both .o and .e logs), and would be fine with having warnings do the same. |
I agree. |
Will this have any impact on where the various "Warnings" from |
No, it does not affect how other commands choose to report warnings. If they choose to use stderr, it will be on stderr. FYI, it appears all "log messages" from wb_command (even debug, if enabled) go to stderr at present. The only things that go to stdout are things that don't use the logging macros. |
Expose number of wisharts and make a melodic-like mode for icaDim, update example scripts to match.