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

[ENH][WIP] Add a new customLabel feature using dcmTags for all acquisitions #60

Closed

Conversation

arnaudbore
Copy link
Contributor

@arnaudbore arnaudbore commented Jul 25, 2019

This PR is usefull when you have a lot of tasks and to make it work you have to have a description for each task. It won't be used for filtering but for naming the output file, the same kind of way customLabel is working.

Now you can simply add:

"dcmTagLabel": {
		"dcmTag": "SeriesDescription",
		"expression": [".*(task-[0-9a-zA-Z]*).*",
			       ".*(run-[0-9]*).*"]
                },
"descriptions": [
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "criteria": {
                "SeriesDescription": "*task*"
            }
        }

instead of

"descriptions": [
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabel": "task-learning",
            "criteria": {
                "SeriesDescription": "*task-learning*"
            }
        },
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabel": "task-movie",
            "criteria": {
                "SeriesDescription": "*task-movie*"
            }
        },
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabel": "task-memory"_run-1,
            "criteria": {
                "SeriesDescription": "*task-memory*run-1*"
          },
          {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabel": "task-memory"_run-2,
            "criteria": {
                "SeriesDescription": "*task-memory*run-2*"
          }
        }

Using this generic way, I had to re-define the way IntendedFor was working.
Hope this new feature will help to have cleaner config files.

@arnaudbore arnaudbore changed the title Add a new generic filter for all acquisitions Add a new customLabel feature using dcmTags for all acquisitions Jul 25, 2019
@bpinsard
Copy link

bpinsard commented Apr 6, 2020

From what I understand, it can only extract information from a single dicom tag. Would it be possible to make it generalize to extract from multiple tags.

The most flexible way, would be to use regexp named capture groups, then being able to reinject the captured variables in the customLabels.

something like

"extractors" : {
"SeriesDescription": "task-(?P<task>[a-zA-Z0-9]+)_run-(?P<run>[0-9]+)",
"BodyPartExamined": "(?P<bodypart>[a-zA-Z]+)"
},

"descriptions": [
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabel": "task-\g<task>_run-\g<run>",
            "criteria": {
                "SeriesDescription": "func.*"
            }
        },
        {
            "dataType": "anat",
            "modalityLabel": "T1w",
            "customLabel": "bp-\g<bodypart>",
            "criteria": {
                "SeriesDescription": ".*T1w"
            }
        },
]

@arnaudbore arnaudbore changed the title Add a new customLabel feature using dcmTags for all acquisitions [ENH][WIP] Add a new customLabel feature using dcmTags for all acquisitions Jan 22, 2021
@arnaudbore
Copy link
Contributor Author

New PR #208

@arnaudbore arnaudbore closed this Jun 20, 2023
@arnaudbore arnaudbore deleted the useTaskWithinSeriesDescription branch July 3, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants