[Loris-dev] Questions and errors uploading BIDS

Cecile Madjar cecile.madjar at mcin.ca
Mon Jul 19 11:26:21 EDT 2021


Hi Alfredo,

For the acquisition date, try the following query:
SELECT pf.Value FROM parameter_file pf JOIN parameter_type pt USING
(ParameterTypeID) WHERE pt.Name="scan_acquisition_time" AND FileID=428983;

For 2., what does the following query return?
SELECT DISTINCT Current_stage FROM session WHERE CandID=207019;

Cécile

On Mon, Jul 19, 2021 at 11:19 AM Morales Pinzon, Alfredo <
AMORALESPINZON at bwh.harvard.edu> wrote:

> Hi Cécile,
>
> I patched LORIS and inserted one visit.
>
> Before moving forward I want to make sure the acquisition date was
> inserted, could you please tell me what is the “ParameterFileID” for the
> acquisition date, I looked at the table parameter_file using one of the
> FileIDs from the last insertion but couldn't find the acquisition date. See
> the result of the query below.
>
> 2. The front-end is still crashing. This is the log:
>
> ===
> [php7:error] [pid 32588] [client 155.33.137.12:23564] PHP Fatal error:
>  Uncaught TypeError: Return value of Utility::getStageUsingCandID() must be
> of the type string, null returned in
> /var/www/loris/php/libraries/Utility.class.inc:632\nStack trace:\n#0
> /var/www/loris/modules/instrument_list/php/instrument_list.class.inc(177):
> Utility::getStageUsingCandID('207019')\n#1
> /var/www/loris/php/libraries/NDB_Page.class.inc(707):
> LORIS\\instrument_list\\Instrument_List->setup()\n#2
> /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(234):
> NDB_Page->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#3
> /var/www/loris/src/Middleware/PageDecorationMiddleware.php(56):
> LORIS\\Middleware\\UserPageDecorationMiddleware->process(Object(Laminas\\Diactoros\\ServerRequest),
> Object(LORIS\\instrument_list\\Instrument_List))\n#4
> /var/www/loris/php/libraries/NDB_Page.class.inc(692):
> LORIS\\Middleware\\PageDecorationMiddleware->process(Object(Laminas\\Diactoros\\ServerRequest),
> Object(LORIS\\instrument_list\\Instrument_List))\n#5
> /var/www/loris/modules/instrument_list/php/instrument_list.class.inc(137):
> NDB_Page->pro in /var/www/loris/php/libraries/Utility.class.inc on line
> 632, referer:
> https://ipmsa-loris.bic.mni.mcgill.ca/candidate_profile/207019/
> ===
>
> Happy to have a Zoom call if it helps.
>
> Thank you for your help.
>
> Best,
> Alfredo.
>
> ===
> select ParameterFileID,Value from parameter_file where FileID=428983;
>
> +-----------------+----------------------------------------------------------------------------------------------------------------------------------+
> | ParameterFileID | Value
>                                                                            |
>
> +-----------------+----------------------------------------------------------------------------------------------------------------------------------+
> |       109949932 | MR
>                                                                           |
> |       109949967 | 130
>                                                                            |
> |       109949981 | 0.9765625
>                                                                            |
> |       109949977 | syngo_MR_A35_4VA35A
>                                                                            |
> |       109949958 | 12:13:34.360020
>                                                                            |
> |       109949968 | t1_RIPOSIZ.
>                                                                            |
> |       109949973 | SK_SP_OSP
>                                                                            |
> |       109949962 | 2D
>                                                                           |
> |       109949960 | [0.999742, 0.000840254, 0.0226824, 1.88704e-10,
> 0.999315, -0.0370189]
>      |
> |       109949982 | 0.9765625
>                                                                            |
> |       109949975 | 5
>                                                                            |
> |       109949969 | CP_HeadArray
>                                                                           |
> |       109949965 | 70.3125
>                                                                            |
> |       109949966 | i
>                                                                            |
> |       109949945 | 0.187383
>                                                                           |
> |       109949978 | 3
>                                                                            |
> |       109949963 | 1.5
>                                                                            |
> |       109949976 | 3
>                                                                            |
> |       109949970 | 0.655
>                                                                            |
> |       109949964 | HFS
>                                                                            |
> |       109949974 | t1_RIPOSIZ.
>                                                                            |
> |       109949971 | SE
>                                                                           |
> |       109949956 | 99
>                                                                           |
> |       109949959 | 0.01
>                                                                           |
> |       109949930 | Siemens
>                                                                            |
> |       109949957 | 1
>                                                                            |
> |       109949983 | 2.9999998
>                                                                            |
> |       109949985 |
> 207019/sub-ANOM_ses-endoftreatment_ce-Gd_run-1_T1w_ZZZ_check.png
>                                               |
> |       109949972 | _tse2d1_5
>                                                                            |
> |       109949914 | 20140629
>                                                                           |
> |       109949915 | 99
>                                                                           |
> |       109949916 | 1
>                                                                            |
> |       109949917 | 12:13:34.360020
>                                                                            |
> |       109949918 | 256
>                                                                            |
> |       109949919 | dcm2niix
>                                                                           |
> |       109949920 | v1.0.20180622 (JP2:OpenJPEG) (JP-LS:CharLS) GCC7.3.0
>                                                                           |
> |       109949921 | 0.01
>                                                                           |
> |       109949923 | 150
>                                                                            |
> |       109949924 | [0.999742, 0.000840254, 0.0226824, 1.88704e-10,
> 0.999315, -0.0370189]
>      |
> |       109949925 | ['ORIGINAL', 'PRIMARY', 'M', 'ND']
>                                                                           |
> |       109949926 | ROW
>                                                                            |
> |       109949928 | 2D
>                                                                           |
> |       109949929 | 1.5
>                                                                            |
> |       109949931 | Sonata
>                                                                           |
> |       109949933 | 1
>                                                                            |
> |       109949934 | HFS
>                                                                            |
> |       109949935 | 70.3125
>                                                                            |
> |       109949936 | i
>                                                                            |
> |       109949937 | 100
>                                                                            |
> |       109949938 | 0.55
>                                                                           |
> |       109949939 | 130
>                                                                            |
> |       109949940 | t1_RIPOSIZ.
>                                                                            |
> |       109949941 | %SiemensSeq%_tse
>                                                                           |
> |       109949942 | CP_HeadArray
>                                                                           |
> |       109949943 | 512
>                                                                            |
> |       109949944 | 0.655
>                                                                            |
> |       109949946 | SE
>                                                                           |
> |       109949947 | _tse2d1_5
>                                                                            |
> |       109949948 | SK_SP_OSP
>                                                                            |
> |       109949949 | t1_RIPOSIZ.
>                                                                            |
> |       109949950 | 5
>                                                                            |
> |       109949951 | [48, 57, 59, 361, 234, 67, -246, 256]
>                                                                            |
> |       109949952 | 3
>                                                                            |
> |       109949953 | syngo_MR_A35_4VA35A
>                                                                            |
> |       109949954 | 3
>                                                                            |
> |       109949955 | 202.922
>                                                                            |
> |       109949961 | ['ORIGINAL', 'PRIMARY', 'M', 'ND']
>                                                                           |
> |       109949979 |
> bids_imports/INFORMS_BIDSVersion_1.4.0/sub-ANOM/ses-endoftreatment/anat/sub-ANOM_ses-endoftreatment_run-1_T1w.json
>     |
> |       109949980 |
> 7655f29d97c14a6b88055f99c7879097650c31cafa7405a1ad3a93062d04669417f42b67c175e9ad904da1e1bb677b2fb6a44ed8b26af482a4d3c40498f284df
> |
> |       109949984 |
> 3f487183fe830d801477568aec824c967a44d3bf3feb9cbd6575830d31b90b089cc625a037c487d3985fb10ee0a00f2eac824980955949c8955cdd304ea838b9
> |
> |       109949922 | 5
>                                                                            |
> |       109949927 | 1
>                                                                            |
>
> +-----------------+----------------------------------------------------------------------------------------------------------------------------------+
> ===
>
> This is the content of the *_scan.tsv file:
> ===
> filename        acq_time
> anat/sub-ANOM_ses-endoftreatment_run-1_T1w.nii.gz  2014-06-29T00:00:00
> anat/sub-ANOM_ses-endoftreatment_ce-Gd_run-1_T1w.nii.gz
>  2014-06-29T00:00:00
> anat/sub-ANOM_ses-endoftreatment_run-1_FLAIR.nii.gz
>  2014-06-29T00:00:00
> anat/sub-ANOM_ses-endoftreatment_ce-Gd_run-2_T1w.nii.gz
>  2014-06-29T00:00:00
> anat/sub-ANOM_ses-endoftreatment_run-1_PD.nii.gz   2014-06-29T00:00:00
> anat/sub-ANOM_ses-endoftreatment_run-1_T2w.nii.gz  2014-06-29T00:00:00
> ===
>
> On Jul 15, 2021, at 5:23 PM, Cecile Madjar <cecile.madjar at mcin.ca> wrote:
>
>         External Email - Use Caution
>
> Hi Alfredo,
>
> Sorry for the delay, I had to take a deeper look at the code to answer
> some of your questions. See below.
>
> > 1. I added the file sub-<label>[_ses-<label>]_scans.tsv as suggested in
>> the BIDS standard (
>> https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#scans-file
>> <https://secure-web.cisco.com/1RT0b_pDRzGh5oEnKt7wHclfIWMewUlzzoH-FStRocNdjI2mrpqsgr33eVaIS22zsvLSZ7Z8ugyaoZ07SHA_O7tObAB409DokII49oyHlFVQnGqaaxEoC_87rcI6ivzH41s36uv9R13FRzaiRJPDhbqmj3kt67BF36UEJp4e5xglyAHPcxx1DV8sf3sJ2TRBCKhNhHUWeRbPM9DdNrFxpoZzYHnN4xy-VMBRK5T9SF4afE6jv3tqdaKdfSYG2wDh-CWrIBbzyeSECIRnMYikelA/https%3A%2F%2Fbids-specification.readthedocs.io%2Fen%2Fstable%2F03-modality-agnostic-files.html%23scans-file>)
>> to add the acquisition dates, do you take it into account to set the dates
>> in LORIS? If not, how can I set the acquisition dates for the images in the
>> session/visit?
>>
>
> Indeed, if you enter a date under an 'acq_time' column in the scans.tsv
> file, it will add an entry in parameter_file for the scan_acquisition_time
> parameter.
>
>
>> >
>> > 2. I am doing the insertion visit by visit to be able to identify
>> issues instead of running all the subjects at once. In this approach I get
>> an error stating that the participants file
>> (".../data/bids_imports/INFORMS_BIDSVersion_1.4.0/participants.tsv") is
>> different from for every execution. Is there a way I can upload subject by
>> subject without having this issue?
>>
>
> yeah, this is a current limitation that this file keeps changing each time
> you upload a new candidate. The pipeline was initially developed for
> retrospective BIDS datasets. We would need to modify this part
> <https://secure-web.cisco.com/1FA74HdTiHzhrcJezSt2K6DKMGwP_wqxcdk1oXclu1U6jCz4rd2fSi-NwskWq_Qfb0p4MTUX6_XEbTFvgo_VxzSI4YiWtniz3W9Yi_Y_Yhd3GKBQD7kKnXK8l0jqEWj-6sZ77YTpIg9X5O235SfFeZ3JW3V5MFXQOH7vMnzgPDBS-6dsjvmCAtnAjP4DJoXkGwQ6VJLV21yWj9np6NfjWvjphVgXfpYnIoS4jb57yVl8xBW0ttGeejb-HEHsaZ-bNfre-16KCLmR-IJO3pZbnwg/https%3A%2F%2Fgithub.com%2Faces%2FLoris-MRI%2Fblob%2Fb5a6fc8cc3cf1fad50df21d9d87a284981705e3c%2Fpython%2Fbids_import.py%23L299> for
> prospective datasets so that instead of just trying to copy the
> participants.tsv file, if it already exists, it would append a row into the
> already existing file. You can find a fix for that in the following PR
> https://github.com/aces/Loris-MRI/pull/645
> <https://secure-web.cisco.com/1Tpg7v8DtF0HJJEnPZUNGN7gwCdF7vLrM19WZmYU8p4-riYcbJ1FVNYH0FGEvIBT0KwSYUMgtVeulxeEaGSohphmm0NQn8wIbxh5cSX4VwbKcKLhvQY1RtnS2SxEKUi4Pln5KHxRYDcVhz9sWnZ6EIhfZEDECvkuT2-zTt24B5MMeBduiQG8W3Pqa7Qr2oEjJW_m84bq0EVtbGQmu5ZVKytj8tPkwWAUE8gTEtLOb1DjwDX5O8y8EHAN_8lf2ZqJ9eojMRDufJj2QObf0g02n3Q/https%3A%2F%2Fgithub.com%2Faces%2FLoris-MRI%2Fpull%2F645>
> .
>
>
>> >
>> > If l have to launch the whole dataset, is the bids script able to check
>> what was already inserted in case there is an error and I have to it again?
>>
>
> Yes, the pipeline is supposed to be smart enough to not reinsert something
> that was previously inserted.
>
>
>> >
>> > 3. After insertion of BIDS for a subject in a visit I cannot access the
>> visit in the front end, I am getting a 500 error. Here is the error log in
>> LORIS:
>> >
>> > ===
>> > [Mon Jul 12 12:05:37.705967 2021] [php7:error] [pid 14497] [client
>> 216.15.126.108:55424
>> <http://secure-web.cisco.com/1WYhYdfRTqaTteJ_4rndbHmww7uTfLympsocUwkjHV2oHQVOQ_ddIjv7AcfCoiP5cJIbw5iksCEFI9RVOxA3_lM6etO-PCaDz89PgNjaEjQPMC5dEfLOft3B7YhP7TCF4ISn-hvCOCFnhQqmRbs9zS1PRbVr6qe_Fra0AR2dZzskzHnYp2A_u29fTzE5u8vYJLMpl4t10wah4Bga-hhoD3gkgnRHVU5KAWy4uwX30Ma4tng8DnVlqBopiM9DpYE6ZEviZpdmHvWqJZxPHxbnHOw/http%3A%2F%2F216.15.126.108%3A55424>]
>> PHP Fatal error:  Uncaught TypeError: Return value of
>> Utility::getStageUsingCandID() must be of the type string, null returned in
>> /var/www
>> > /loris/php/libraries/Utility.class.inc:632\nStack trace:\n#0
>> /var/www/loris/modules/instrument_list/php/instrument_list.class.inc(177):
>> Utility::getStageUsingCandID('207019')\n#1
>> /var/www/loris/php/libraries/NDB_Page.class.inc(
>> > 707): LORIS\\instrument_list\\Instrument_List->setup()\n#2
>> /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(234):
>> NDB_Page->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#3
>> /var/www/loris/src/Middleware/PageD
>> > ecorationMiddleware.php(56):
>> LORIS\\Middleware\\UserPageDecorationMiddleware->process(Object(Laminas\\Diactoros\\ServerRequest),
>> Object(LORIS\\instrument_list\\Instrument_List))\n#4
>> /var/www/loris/php/libraries/NDB_Page.class.i
>> > nc(692):
>> LORIS\\Middleware\\PageDecorationMiddleware->process(Object(Laminas\\Diactoros\\ServerRequest),
>> Object(LORIS\\instrument_list\\Instrument_List))\n#5
>> /var/www/loris/modules/instrument_list/php/instrument_list.class.inc(
>> > 137): NDB_Page->pro in /var/www/loris/php/libraries/Utility.class.inc
>> on line 632, referer:
>> https://ipmsa-loris.bic.mni.mcgill.ca/candidate_profile/207019/
>> <https://secure-web.cisco.com/1XkKe3e3JkFCEbEAQx3rrZ25ZCaDXFH7ViiHfRCVtt0ZTI9ckG_4i5CYOnY_Wv0SYfmdvUUZ0jQkdjvUgzKY9qJfqnqcVF_7n2nRaR-c1a4U_Y95LN-Dv96I8j-OBHltZ52DoTaYZ9RvB7YL9vP82yG9pUb2XlYJwK6xA6b2gGwhHhyqpdrPfRW0HZFx4__6pDI4CU5CQWx9_dteaDW3_xjntBo3296km9H-nJNiywrGrKtv_1pO6wCU5ygXs2bqXwZ9j7X4eILwCv0N7S7PlKA/https%3A%2F%2Fipmsa-loris.bic.mni.mcgill.ca%2Fcandidate_profile%2F207019%2F>
>> > ===
>>
>
> This might be due to the Current_stage not being set when creating the
> visit via the bids_import.py script. Here is a PR to fix that issue next
> time you import a new visit via bids_import.py:
> https://github.com/aces/Loris-MRI/pull/644
> <https://secure-web.cisco.com/1RuRCEtVgtWrK7Pm95g10P8zRltmw5fqwt4wM4vzTM2N7zp7p8HXJKNSQo5QSAfOa23ID04z8m13DojdlnneipDRp6yoYNUJIoorexU5ixp49Alwi5aaHokrOmz-gRnpRkrUxMNI04i2tsCDBAsyiwIBoMwgWyCGHg8asEvLiHrEcYtWAdRycS4UQ7Udt6hrVhp6DqF6kpBH3s4oWPPlFvnJ9CHywNOno0NqHI0zXVnlWI2BuIW0heLJeaDSyrvK-5FcYxqhfnBEJTq1hkNB-Jg/https%3A%2F%2Fgithub.com%2Faces%2FLoris-MRI%2Fpull%2F644>
>
>
> Hope this helps,
>
> Cécile
>
>
> The information in this e-mail is intended only for the person to whom it
> is addressed. If you believe this e-mail was sent to you in error and the
> e-mail contains patient information, please contact the Mass General
> Brigham Compliance HelpLine at
> http://www.massgeneralbrigham.org/complianceline . If the e-mail was sent
> to you in error but does not contain patient information, please contact
> the sender and properly dispose of the e-mail.
>
> Please note that this e-mail is not secure (encrypted).  If you do not
> wish to continue communication over unencrypted e-mail, please notify the
> sender of this message immediately.  Continuing to send or respond to
> e-mail after receiving this message means you understand and accept this
> risk and wish to continue to communicate over unencrypted e-mail.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20210719/57bd6c2f/attachment-0001.html>


More information about the Loris-dev mailing list