-
Notifications
You must be signed in to change notification settings - Fork 45
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
Chopping files semi-automatically #36
Comments
This is a topic we briefly discussed at DCCC 2019 with @yarikoptic . |
I have some MATLAB code that does this semi-automatically (it uses triggers for the time stamps alongside user input). At a later date, I could attempt to adapt this for phys2bids, if we wanted it. |
An important related point to "chopping" files. I think there are two options:
|
@tsalo might have an idea on how to do this! |
I haven't had a chance to finalize it, but my approach with BioPac involves the following:
I don't think this would require user input beyond the heuristic file (for optional durations and settings regarding physio data before and after the scan to retain). |
I have some working MATLAB code which I use to chop up a file which contains multiple scans. I will explain what it does here, in case any part of it is appealing to adapt for phys2bids. I haven't thought about how this would interact with BIDS as @tsalo has done, though! So incorporating in some of his good ideas would make sense too. I have a function that reads in the input text file, alongside other arguments relevant to that scan - trigger column, sampling frequency, number of time points, amount of extra time before and after the scan to export the physiological data, and a json file which reads in slice timing information(from a DICOM to NIFTI conversion). At the moment, I have the user clicking before and after the scan (Fig1) and then I find the closest trigger to their click to get the index for the start and end. The output summary (Fig2, and Fig3 - zoomed in) shows the user the time window that will be exported into a single file (with triggers binarized). The other plots in Fig2/3 relate to the fact that the user can ask to “make up” volume triggers and excite triggers. Is this too much user interaction for chopping up files? I.e. Would we want some way of doing it completely automatically? |
@RayStick Sorry i didn't see this earlier. It's a bit of user interaction more than the optimal, and we have to be sure it's not LabChart specific. I was thinking about this issue as well, and I would like to see where #173 goes first, but an easy option would be to add a function that uses what is already in the code in an iterative way.
What do you think? |
hey @smoia, glad to see there could be an elegant way of cutting physio files into chunks corresponding to fMRI acquisition. Two things, I'm having difficulty figuring out how you'd want the users to give the amount of time points per acquisition (
I'm missing some pieces of information here, and I thought it might be helpful for others to know as well. |
Yes, sorry, I didn't mean we have
I'm happy if you jump into this @sangfrois, but please note that this issue is already assigned to @RayStick, so you should at least ask her what is the status of this development and whether she wants to work on it together, transfer assignment, or keep developing it on her own. |
Yeah, for sure. I mean : I was peeking at this issue since it is relevant to my project. I wasn't that invested into the idea of implementing solutions, but more into looking at how things were evolving here. Sorry, @RayStick, my intention was not to intrude in your development or pressure in any way. But, please, feel free to pin me if you need anything. I'd be delighted to give my input if you think I can help. Also, Thanks @smoia for digging deeper in your idea. I'm still at a level of studying how functions are built and how they work together. If I can manage to do that and Rachael is opened to my suggestions , I'll send updates here. |
@sangfrois thanks for your questions, as I was confused about a few of the same things. @smoia - I like the idea you put forward on March 23rd. I think it could definitely work, and it doesn't requires a clunky user interaction, which is good. After steps 1-5 we could plot the data to show the user what scans have been found and how they have been 'chopped' in the file. As we have for the trigger threshold now, if this automatic chopping has not worked correctly, a manual chopping can be implemented. Maybe this manually chopping could be similar to the MATLAB code I explained. @sangfrois - You are not intruding and we're definitely open to suggestions! :) I think this is a really important feature however I don't think I will be able to work on it anytime soon. I am currently doing python tutorials - let's see how fast I can learn! |
@RayStick would you like to work on this in combo, maybe with @sangfrois ? I'm adding it to the first non-beta milestone. |
@smoia - I am happy to be assigned to it, and will do my best to complete this by the first non-beta milestone. By June seems feasible! I am just not certain when I'll start working on it yet, as I want to complete more python tutorials first. So I'm happy for any assistance/ideas, or if people want to get started on it sooner I'm okay with that too (Don't want to hold things up!). |
The questions are two:
|
@smoia On reflection, I have actually decided to assign myself to some other easier issues before tackling something like this, as I think I just need to get used to interacting with phys2bids code more first (and python in general). Therefore, I have taken myself off this issue for now. I will still keep track of the progress and happy to be a PR reviewer for it. |
Ok, thank you @RayStick ! |
And depending on how quickly I make progress with other issues, I may be able to help more with this. But no promises for now. :) |
Alright with if Rachael focuses on other things, and yes, I am going to use this for sure. Though I am still trying to get around the plan you've put together in the past few comments, I am willing to put some effort into that and make sure we can deliver it in time. Of course, I'll need your help and patience as well ( my git workflow is not totally on point yet 😅). I think we'll manage!! |
A lot of researchers will have one physiological file for the whole scan session, which will need to be chopped into separate files corresponding to each scan to be analyzed. Offering a way of semi-automatically chopping these files, and allowing phys2bids to output multiple physiological files from the same input file, would be useful.
The text was updated successfully, but these errors were encountered: