Conversation
|
Nice work! Few minor suggestions:
|
Sure, I can do that. I just did that based on the DataParTemplate.m, where we have these modules within the structural section.
Good idea 👍
Yeah... but why do this multiple times if we can just do it now? The old dataPar.json's should still work, since we added this backwards compatibility feature to the dataPar reader.
I know, we use it as one of these symbolic fields. I think I moved SUBJECTDIR to there as well, so in my head this change kind of makes sense. Does this bug you? 😄
Yeah, I started writing a new DataParTemplate.md, where we can have both .m and .json examples. We can integrate it there if you want. |
|
@jan-petr: Became a really big change after all. I'll run some tests now. You can start to check if you're happy with the changes. I'm not sure about how to update |
TestingInitializationThe initialization seems to work perfectly fine. We didn't change that much there though. >> x = ExploreASL;
ExploreASL will run the initialization...
==============================================================================================
________ __ ______ ______ __
/ | / | / \ / \ / |
########/ __ __ ______ ## | ______ ______ ______ /###### |/###### |## |
## |__ / \ / | / \ ## | / \ / \ / \ ## |__## |## \__##/ ## |
## | ## \/##/ /###### |## |/###### |/###### |/###### |## ## |## \ ## |
#####/ ## ##< ## | ## |## |## | ## |## | ##/ ## ## |######## | ###### |## |
## |_____ /#### \ ## |__## |## |## \__## |## | ########/ ## | ## |/ \__## |## |_____
## |/##/ ## |## ##/ ## |## ##/ ## | ## |## | ## |## ##/ ## |
########/ ##/ ##/ #######/ ##/ ######/ ##/ #######/ ##/ ##/ ######/ ########/
## |
## |
##/
==================================== ExploreASL Settings =====================================
Dataset Root
Import Modules
Process Modules
bPause False
iWorker 1
nWorkers 1
==============================================================================================
ExploreASL v1.8.0_BETA initialized ...
>> x
x =
struct with fields:
opts: [1×1 struct]
S: [1×1 struct]
D: [1×1 struct]
P: [1×1 struct]
Q: [1×1 struct]
modules: [1×1 struct]
dataset: [1×1 struct]
settings: [1×1 struct]
external: [1×1 struct]
dir: [1×1 struct]
Version: '1.8.0_BETA'BIDS 2 LegacyBIDS 2 Legacy doesn't crash and seems to behave normally. >> pathTest = '.\TestDataSet';
>> x = ExploreASL(pathTest,[0 0 0 1],0);
ExploreASL will run the import workflow and will run the initialization...
==============================================================================================
________ __ ______ ______ __
/ | / | / \ / \ / |
########/ __ __ ______ ## | ______ ______ ______ /###### |/###### |## |
## |__ / \ / | / \ ## | / \ / \ / \ ## |__## |## \__##/ ## |
## | ## \/##/ /###### |## |/###### |/###### |/###### |## ## |## \ ## |
#####/ ## ##< ## | ## |## |## | ## |## | ##/ ## ## |######## | ###### |## |
## |_____ /#### \ ## |__## |## |## \__## |## | ########/ ## | ## |/ \__## |## |_____
## |/##/ ## |## ##/ ## |## ##/ ## | ## |## | ## |## ##/ ## |
########/ ##/ ##/ #######/ ##/ ######/ ##/ #######/ ##/ ##/ ######/ ########/
## |
## |
##/
==================================== ExploreASL Settings =====================================
Dataset Root ...\TestDataSet
Import Modules BIDS2LEGACY
Process Modules
bPause False
iWorker 1
nWorkers 1
==============================================================================================
ExploreASL v1.8.0_BETA initialized ...
Parsing BIDS scans: 100%
Note that any warnings may have only printed once if they were repeated for multiple scans
Always run your rawdata folder through the BIDS validator first and aim to avoid warnings
Converting from BIDS to Legacy: .\TestDataS100%
M0 parsed for .\TestDataSet\derivatives\ExploreASL\sub-Sub1\ASL_1\ASL4D.nii.gz
Creating default dataPar.json since file was not found...
Overwriting x.dir.dataPar...
>> x
x =
struct with fields:
opts: [1×1 struct]
S: [1×1 struct]
D: [1×1 struct]
P: [1×1 struct]
Q: [1×1 struct]
modules: [1×1 struct]
dataset: [1×1 struct]
settings: [1×1 struct]
external: [1×1 struct]
dir: [1×1 struct]
Version: '1.8.0_BETA'ProcessingAfter the BIDS 2 Legacy conversion from above, I added the {
"x":
{
"dataset":
{
"name":"ExampleDataSet",
"subjectRegexp":"^sub-Sub\\d{1}$"
},
"settings":
{
"Quality":0,
"DELETETEMP":1
}
},
"Q":
{
"Vendor": "Philips"
},
"GeneratedBy":
{
"Name":"ExploreASL",
"Version":"1.8.0_BETA"
}
}The structural module seems to work just fine, but the ASL module seems buggy. It starts with these warnings: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
=== Subject: sub-Sub1, Session: ASL_1, Module: xASL_module_ASL_<SESSION>, 12-Jul-2021 15:40:05 ===
Cleaning data to rerun subject sub-Sub1
nRemoving lock folders:
Restoring backupped _ORI (original) files:
Deleting native space CAT12 temporary folders:
Deleting native space files for module 2:
Deleting all standard space files for module 2
Cleaning up x-struct:
Cleaning up QC_Collection json:
M0 parameter was missing, set to separate_scan
Warning: x.Q.readoutDim parameter missing, skipping determining ASL sequence
Warning: x.Q.Vendor missing, skipping determining ASL sequence
Warning: No x.Q.Sequence defined
If there are multiple sequence types, this needs to be implemented yet here
Otherwise, please define x.Q.Sequence
Setting x.Q.Sequence=3D spiral to fool the pipeline here
As this sequence doesnt have any susceptibility masks
Note that this disables any masking of susceptibility signal dropout areas
No TopUp scans available, skipping...
...... and because of this, this part right here fails later on... ------------------------------------------------------------------------------------------
Reslicing PVwmh.nii to PWI.nii using 2nd B-spline interpolation
-----------------------------------------------------------------------
Running SPM job 'Coregister: Reslice'
SPM12: spm_reslice (v7141) 15:45:42 - 12/07/2021
========================================================================
Completed : 15:45:43 - 12/07/2021
Done 'Coregister: Reslice'
Done
xASL_Move: overwriting .\TestDataSet\derivatives\ExploreASL\sub-Sub1\ASL_1\PVwmh.nii
ERROR: ASL module terminated for subject 1: sub-Sub1
ans =
'Reference to non-existent field 'Vendor'
xASL_quant_M0 line 68I'm not really sure where I'm actually doing the error. Of course I can just check |
jan-petr
left a comment
There was a problem hiding this comment.
Great that you have thought about automatically upgrading the parameters like x.modules.asl.bUseMNIasDummyStructural
But the following seems not to be updated - it might be nice to make this more automatically within readDataPar.m - make a list of those and not to enter all of them by hand like the bUseMNI... :
bNativeSpaceAnalysis, bPVCNativeSpace, SpikeRemovalThreshold, bRegisterM02ASL, bPVCGaussianMM
We might need to be careful with some of the x-struct internal stuff as well. For processing in progress - people experimenting with different versions:
x.opts.MyPath,
And finally, some fields inside the Q need to be upgraded in the xASL_adm_LoadParms. See my comment there and please do the same for:
bUseBasilQuantification, ApplyQuantification, Vendor
And these need to be somehow considered as well - for renaming and for moving inside the structure - otherwise, this will be a big mess:
motionCorrection, bRunLongReg, bRunDARTEL
I thought about that too. I started by adding the code to a separate function. My only problem was that it's not that easy to automate, since some of the fields get assigned to a field of x whereas other ones are within a sub or subsubstructure 😄 I'll try to think of a better way to do this though.
Yep, I was a bit afraid of changing this. It was actually Henk who mentioned that if we revamp the other fields, we should also do MyPath, SESSIONS and so on. We could implement a simple warning and we should also document/communicate these changes as transparent as possible.
I'm on it. Sorry, I hope my coding doesn't seem too sloppy, it's just hard to keep track of all of these changes.
In one of these code comments I already answered the bRunLongReg and bRunDARTEL thing. Henk specifically asked for them to be within x.modules instead of x.modules.structural. I tried to keep as close as possible to the different sections of the old DataParTemplate.m, where we had Sequence parameters, Structural parameters, Environment parameters, etc. |
|
I'm rerunning the 10 Test datasets right now. Let's see if everything works tomorrow 😄 |
| end | ||
| if nargin<2 || isempty(bAutomaticallyDetectFSL) | ||
| bAutomaticallyDetectFSL = false; | ||
| if isfield(x,'external') && isfield(x.external,'bAutomaticallyDetectFSL') |
There was a problem hiding this comment.
This might need the attention of @HenkMutsaerts as well. Not sure what is the best solution - removing the bAutomatically parameter completely from the function call and only using inside the x-struct version... But this version of default vs x-struct vs implicitly passed might not be bad either... TBD
jan-petr
left a comment
There was a problem hiding this comment.
Looks all very good - except one minor thing in calling FSL - we have to discuss with Henk what was actually intended by this and if we can do it with x-struct only or not...
|
The test dataset |
2ddd773 to
4ea9115
Compare
|
I rebased the commits for testing purposes like Jan suggested... |
GE_3Dspiral_T1prefilled_Cyst_M0_noFLAIR_2ndRun_LoQThere are these warnings... ... which of course lead to an error later on ... EditI think the biggest bug is in |
Philips_2DEPI_FEAST_Longitudinal_FLAIR_LGA_ASL_PartlyDone_HiQHere there are no warnings, but then there's this ... |
Philips_2DEPI_FLAIR_DisabledQuantification_M0_LoQWarnings are similar to GE_3Dspiral_T1prefilled_Cyst_M0_noFLAIR_2ndRun_LoQ, but the error is a bit different ... |
|
@jan-petr: explanation to commits 091db85 and b5e630a: The major problem was that |
Test datasetFinally one more or less successful run: |
HenkMutsaerts
left a comment
There was a problem hiding this comment.
Looks great! One question & one suggested change
-
Does SESSIONDIR fit in x.dir? (it belongs to the processing modules only)
-
M0 is not a general processing setting, but specific to the quantification (x.Q), so I would move it to x.Q
Also, I agree with you that it would be beneficial to initiate many empty structs/x-fields at the beginning of a processing module.
Very nice work!
… table generation A single missing backslash t or missing comma within a TSV or CSV file should not break the pipeline before writing the results to a mat file
I encountered some bugs where the TSV reading did not work if we use xASL_tsvWrite with empty strings within the cell array. We should probably fix it there as well. For know, I fixed this in xASL_stat_PrintStat and xASL_stat_GetDICOMStatistics. I think the multiple subjects/sessions should work now, too. I will run the ten test datasets and then we can see if everything is correct now.
I am a bit surprised how this did work before. For me this breaks the code. It is not possible to assign a character array to a field of a numeric array. This would work for cell array though.
There was a problem with the field initialization coming from the dataPar JSON file. It should work correctly with all basic fields being initialized.
…rt to xasl format
e1ae03f to
aad68a9
Compare

Linked issue
Check out #717
How to test
I ran the following tests ...
Comments
I'd recommend to check each commit one by one.
Overview:
x.MyPathtox.opts.MyPath👍x.Qualitytox.settings.Quality👍x.DELETETEMPtox.settings.DELETETEMP👍x.SESSIONDIR->x.dir.SESSIONDIR👍x.T1BiasFieldRegularization->x.modules.structural.T1BiasFieldRegularization👍x.bNativeSpaceAnalysis->x.modules.population.bNativeSpaceAnalysis👍x.bHammersCAT12->x.modules.structural.bHammersCAT12👍x.bFixResolution->x.modules.structural.bFixResolution👍x.SegmentSPM12->x.modules.structural.SegmentSPM12👍x.bRunModule_DARTEL->x.modules.bRunDARTEL👍x.bRunModule_LongReg->x.modules.bRunLongReg👍x.SkipIf...->x.settings.SkipIf...👍x.ForceInclusionList->x.dataset.ForceInclusionList👍x.bAutomaticallyDetectFSL->x.external.bAutomaticallyDetectFSL👍x.MakeNIfTI4DICOM->x.settings.MakeNIfTI4DICOM👍x.subject_regexptox.dataset.subjectRegexp👍x.Vendortox.Q.Vendor👍x.readout_dimtox.Q.readoutDim👍x.nametox.dataset.name👍x.Sequencetox.Q.Sequence👍If there's enough time, we could convert the DataParTemplate.m to a DataParTemplate.md