Conversation
|
@jkroell Hi! Thanks for the feature request. Not sure I understand it correctly, do you want an option to perform temporal slicing at the marker level or do you want a preprocessor? |
|
I think this can be implemented at different levels, either in preprocessing or in the marker. I guess making it part of preprocessing with make it more general and applicable across different markers? |
|
@kaurao Ok then we go with a new preprocessor. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
==========================================
+ Coverage 86.13% 91.09% +4.96%
==========================================
Files 133 134 +1
Lines 5617 5422 -195
Branches 950 903 -47
==========================================
+ Hits 4838 4939 +101
+ Misses 600 309 -291
+ Partials 179 174 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@jkroell How do you like this interface? preprocess:
- kind: TemporalSlicer
start: 0 # int, in second
stop: 168 # int, in second
t_r: 2.0 # float, in second (TR) |
start and stop, if in seconds, should be floats. If we have sub-second TR we are in trouble. We'll most probably have rounding errors. |
|
Adding a |
Why can't we support both? It's easier to copy/paste a yaml and then change the tstart if you want to analyse 10 minutes from T0 and 10 minutes from T1, where T1 is a number that we know from the acquisition. |
Making them floats is a good idea to be more precise with slicing. I anyway do an int conversion to take care of that, most you get is an IndexError. |
Of course we can, not a problem. Just wanted to make sure there's a proper use case. |
This is taken care of now. |
If we can do the math for the user, better. I had this use case recently because someone merged resting with a task so I had to discard some volumes at the begining. Which also makes me think that in that case I needed:
Another possible use case:
|
|
I like the interface! Would it be an option to automatically get the TR, or do you think the user should set that himself? |
If the TR is not specified, it will be taken from the images. However, keep in mind that some software do not take care of the TR properly, so it's always good to have an option to fix it manually. |
Okay, makes sense! Looks good to me, then. |
|
@jkroell Was about to reply, but Fede already gave a nice answer. |
|
@fraimondo Ok so now we can have The interface now looks like:
preprocess:
- kind: TemporalSlicer
start: 0.0 # float, in second
stop: -2.0 # -ve float, in second
preprocess:
- kind: TemporalSlicer
start: 10.0 # float, in second
stop: null
preprocess:
- kind: TemporalSlicer
start: 10.0 # float, in second; start at 10s
stop: null
duration: 20.0 # float, in second; stop at 30sDoes it make sense now? @fraimondo @jkroell @kaurao |
Yes! Perfect sense. And you are right, we need to adjust the confounds so they match. Though I believe this should be used after confound removal. |
Ideally it should be after confound removal, but is there a case where one can do it before confound removal or can use the confounds in markers? |
We need to be consistent. So I agree with you. Any picking on the BOLD timeseries should also pick any other data that matches. |
Okay then I'll make the necessary changes. |
290d50f to
5d020e5
Compare
|
@fraimondo Updated the code to reflect confounds manipulation, I'll request a review, feel free to add more comments before reviewing. |
|
@fraimondo Shall we get this in? |
36220d6 to
cc3860f
Compare
|
Using the slicer after confound removal worked successfully. Thanks for adding this! |
TemporalSlicer
Are you requiring a new dataset or marker?
Which feature do you want to include?
To have the option to define which segment of the time series to use for extracting connectomes (define start and end point). For example, cut a 20-minute sequence after 10 minutes and extract connectomes from only the second part.
Use-Case: We have a 24 minute sequence with a task and a control task performed sequentially and want to analyze them separately.
How do you imagine this integrated in junifer?
Cut the time series before calculating the connectomes.
Do you have a sample code that implements this outside of junifer?
Anything else to say?
@kaurao