-
Notifications
You must be signed in to change notification settings - Fork 13
Fixes #762 xASL_stat_GetDICOMStatistics: Improve TSV cell array fixing #763
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
Conversation
HenkMutsaerts
left a comment
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.
Would resort to 'n/a', otherwise good!
| for iColumn=1:size(TSV,2) | ||
| % Remove lists (we had a problem where it was tried to insert SliceTiming arrays into the table) | ||
| if size(TSV{iRow,iColumn},1)>1 | ||
| TSV{iRow,iColumn} = 'n/a'; |
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.
But shouldn't this produce a warning? The pipeline should never suddenly introduce lists inside one cell. This could be the case in the import module, but not in the other modules.
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.
They could be defined manually though. I only encountered this once, but for multiple visits/subjects you could potentially get a LOT of warnings
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.
Sure, then we can keep track of the warning and limit the number of its outputs
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 added a warning for now, let's see how it turns out fd9f2f4
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 have an alternative solution for more transparency. If there's a list, then report it is a list instead of "n/a". You can either print "list" or "field1, field2,..."
| end | ||
| % Remove empty elements (Empty cells in the TSV can lead to reading errors) | ||
| if isempty(TSV{iRow,iColumn}) | ||
| TSV{iRow,iColumn} = '_'; |
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.
Why the underscore? Why not 'n/a' like in the other cases?
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.
Because we write this table where we have empty places and if we write '' to the cell array some tsv readers crash. We did this before and it looks quite okay I think.
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.
We have things like:
row description COLUMN 1 COLUMN2 COLUMN 3
row description value value value
row description EMPTYCOLUMN COLUMN 1 COLUMN2
row description _ value value
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 don't like it, but for that use case it's the cleanest solution IMHO
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 like this strategy, I just think that '_' is arbitrary, whereas BIDS defaults to 'n/a' for missing values. So it seems we should use this as well right?
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.
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 am fine with that. I would merge as is and change in the future if we find this weird. Unless Henk has a different opinion.
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.
Ah I see, nice. So all missing values, irrespective their meaning/format, will be 'n/a', according to BIDS. Only the empty placeholder cells will be an underscore '_', that looks good.
| for iColumn=1:size(TSV,2) | ||
| % Remove lists (we had a problem where it was tried to insert SliceTiming arrays into the table) | ||
| if size(TSV{iRow,iColumn},1)>1 | ||
| TSV{iRow,iColumn} = 'n/a'; |
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.
Sure, then we can keep track of the warning and limit the number of its outputs
|
@jan-petr could you check this out while Henk is on vacation? |
jan-petr
left a comment
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.
See my comments. Let's have a final consensus with Henk. But in principle, we can merge.
| for iColumn=1:size(TSV,2) | ||
| % Remove lists (we had a problem where it was tried to insert SliceTiming arrays into the table) | ||
| if size(TSV{iRow,iColumn},1)>1 | ||
| TSV{iRow,iColumn} = 'n/a'; |
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 have an alternative solution for more transparency. If there's a list, then report it is a list instead of "n/a". You can either print "list" or "field1, field2,..."
| end | ||
| % Remove empty elements (Empty cells in the TSV can lead to reading errors) | ||
| if isempty(TSV{iRow,iColumn}) | ||
| TSV{iRow,iColumn} = '_'; |
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 am fine with that. I would merge as is and change in the future if we find this weird. Unless Henk has a different opinion.
| end | ||
| % Remove empty elements (Empty cells in the TSV can lead to reading errors) | ||
| if isempty(TSV{iRow,iColumn}) | ||
| TSV{iRow,iColumn} = '_'; |
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.
Ah I see, nice. So all missing values, irrespective their meaning/format, will be 'n/a', according to BIDS. Only the empty placeholder cells will be an underscore '_', that looks good.
fd9f2f4 to
add6a58
Compare

Linked issue
#762
Comments
@BeatrizPadrela & @HenkMutsaerts: would be cool if you would test this to validate that it's working correctly.