<div dir="ltr">Hi Alfredo,<div><br></div><div>For the acquisition date, try the following query:</div><div>SELECT pf.Value FROM parameter_file pf JOIN parameter_type pt USING (ParameterTypeID) WHERE pt.Name="scan_acquisition_time" AND FileID=428983;</div><div><br></div><div>For 2., what does the following query return?</div><div>SELECT DISTINCT Current_stage FROM session WHERE CandID=207019;</div><div><br></div><div>Cécile</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 19, 2021 at 11:19 AM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
<div dir="auto" style="overflow-wrap: break-word;">
Hi Cécile, 
<div><br>
</div>
<div>I patched LORIS and inserted one visit.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>2. The front-end is still crashing. This is the log:</div>
<div><br>
</div>
<div>===</div>
<div>[php7:error] [pid 32588] [client <a href="http://155.33.137.12:23564" target="_blank">155.33.137.12:23564</a>] 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:
<a href="https://ipmsa-loris.bic.mni.mcgill.ca/candidate_profile/207019/" target="_blank">
https://ipmsa-loris.bic.mni.mcgill.ca/candidate_profile/207019/</a></div>
<div>===</div>
<div><br>
</div>
<div>Happy to have a Zoom call if it helps.<br>
<div><br>
</div>
<div>Thank you for your help.</div>
<div><br>
</div>
<div>Best,</div>
<div>Alfredo.</div>
<div><br>
</div>
<div>===</div>
<div>
<div>select ParameterFileID,Value from parameter_file where FileID=428983;</div>
<div>+-----------------+----------------------------------------------------------------------------------------------------------------------------------+</div>
<div>| ParameterFileID | Value                                                                                                                            |</div>
<div>+-----------------+----------------------------------------------------------------------------------------------------------------------------------+</div>
<div>|       109949932 | MR                                                                                                                               |</div>
<div>|       109949967 | 130                                                                                                                              |</div>
<div>|       109949981 | 0.9765625                                                                                                                        |</div>
<div>|       109949977 | syngo_MR_A35_4VA35A                                                                                                              |</div>
<div>|       109949958 | 12:13:34.360020                                                                                                                  |</div>
<div>|       109949968 | t1_RIPOSIZ.                                                                                                                      |</div>
<div>|       109949973 | SK_SP_OSP                                                                                                                        |</div>
<div>|       109949962 | 2D                                                                                                                               |</div>
<div>|       109949960 | [0.999742, 0.000840254, 0.0226824, 1.88704e-10, 0.999315, -0.0370189]                                                            |</div>
<div>|       109949982 | 0.9765625                                                                                                                        |</div>
<div>|       109949975 | 5                                                                                                                                |</div>
<div>|       109949969 | CP_HeadArray                                                                                                                     |</div>
<div>|       109949965 | 70.3125                                                                                                                          |</div>
<div>|       109949966 | i                                                                                                                                |</div>
<div>|       109949945 | 0.187383                                                                                                                         |</div>
<div>|       109949978 | 3                                                                                                                                |</div>
<div>|       109949963 | 1.5                                                                                                                              |</div>
<div>|       109949976 | 3                                                                                                                                |</div>
<div>|       109949970 | 0.655                                                                                                                            |</div>
<div>|       109949964 | HFS                                                                                                                              |</div>
<div>|       109949974 | t1_RIPOSIZ.                                                                                                                      |</div>
<div>|       109949971 | SE                                                                                                                               |</div>
<div>|       109949956 | 99                                                                                                                               |</div>
<div>|       109949959 | 0.01                                                                                                                             |</div>
<div>|       109949930 | Siemens                                                                                                                          |</div>
<div>|       109949957 | 1                                                                                                                                |</div>
<div>|       109949983 | 2.9999998                                                                                                                        |</div>
<div>|       109949985 | 207019/sub-ANOM_ses-endoftreatment_ce-Gd_run-1_T1w_ZZZ_check.png                                                         |</div>
<div>|       109949972 | _tse2d1_5                                                                                                                        |</div>
<div>|       109949914 | 20140629                                                                                                                         |</div>
<div>|       109949915 | 99                                                                                                                               |</div>
<div>|       109949916 | 1                                                                                                                                |</div>
<div>|       109949917 | 12:13:34.360020                                                                                                                  |</div>
<div>|       109949918 | 256                                                                                                                              |</div>
<div>|       109949919 | dcm2niix                                                                                                                         |</div>
<div>|       109949920 | v1.0.20180622 (JP2:OpenJPEG) (JP-LS:CharLS) GCC7.3.0                                                                             |</div>
<div>|       109949921 | 0.01                                                                                                                             |</div>
<div>|       109949923 | 150                                                                                                                              |</div>
<div>|       109949924 | [0.999742, 0.000840254, 0.0226824, 1.88704e-10, 0.999315, -0.0370189]                                                            |</div>
<div>|       109949925 | ['ORIGINAL', 'PRIMARY', 'M', 'ND']                                                                                               |</div>
<div>|       109949926 | ROW                                                                                                                              |</div>
<div>|       109949928 | 2D                                                                                                                               |</div>
<div>|       109949929 | 1.5                                                                                                                              |</div>
<div>|       109949931 | Sonata                                                                                                                           |</div>
<div>|       109949933 | 1                                                                                                                                |</div>
<div>|       109949934 | HFS                                                                                                                              |</div>
<div>|       109949935 | 70.3125                                                                                                                          |</div>
<div>|       109949936 | i                                                                                                                                |</div>
<div>|       109949937 | 100                                                                                                                              |</div>
<div>|       109949938 | 0.55                                                                                                                             |</div>
<div>|       109949939 | 130                                                                                                                              |</div>
<div>|       109949940 | t1_RIPOSIZ.                                                                                                                      |</div>
<div>|       109949941 | %SiemensSeq%_tse                                                                                                                 |</div>
<div>|       109949942 | CP_HeadArray                                                                                                                     |</div>
<div>|       109949943 | 512                                                                                                                              |</div>
<div>|       109949944 | 0.655                                                                                                                            |</div>
<div>|       109949946 | SE                                                                                                                               |</div>
<div>|       109949947 | _tse2d1_5                                                                                                                        |</div>
<div>|       109949948 | SK_SP_OSP                                                                                                                        |</div>
<div>|       109949949 | t1_RIPOSIZ.                                                                                                                      |</div>
<div>|       109949950 | 5                                                                                                                                |</div>
<div>|       109949951 | [48, 57, 59, 361, 234, 67, -246, 256]                                                                                            |</div>
<div>|       109949952 | 3                                                                                                                                |</div>
<div>|       109949953 | syngo_MR_A35_4VA35A                                                                                                              |</div>
<div>|       109949954 | 3                                                                                                                                |</div>
<div>|       109949955 | 202.922                                                                                                                          |</div>
<div>|       109949961 | ['ORIGINAL', 'PRIMARY', 'M', 'ND']                                                                                               |</div>
<div>|       109949979 | bids_imports/INFORMS_BIDSVersion_1.4.0/sub-ANOM/ses-endoftreatment/anat/sub-ANOM_ses-endoftreatment_run-1_T1w.json     |</div>
<div>|       109949980 | 7655f29d97c14a6b88055f99c7879097650c31cafa7405a1ad3a93062d04669417f42b67c175e9ad904da1e1bb677b2fb6a44ed8b26af482a4d3c40498f284df |</div>
<div>|       109949984 | 3f487183fe830d801477568aec824c967a44d3bf3feb9cbd6575830d31b90b089cc625a037c487d3985fb10ee0a00f2eac824980955949c8955cdd304ea838b9 |</div>
<div>|       109949922 | 5                                                                                                                                |</div>
<div>|       109949927 | 1                                                                                                                                |</div>
<div>+-----------------+----------------------------------------------------------------------------------------------------------------------------------+</div>
</div>
<div>===</div>
<div><br>
</div>
<div>This is the content of the *_scan.tsv file:</div>
<div>===</div>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal">
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">filename        acq_time</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_run-1_T1w.nii.gz  2014-06-29T00:00:00</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_ce-Gd_run-1_T1w.nii.gz    2014-06-29T00:00:00</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_run-1_FLAIR.nii.gz        2014-06-29T00:00:00</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_ce-Gd_run-2_T1w.nii.gz    2014-06-29T00:00:00</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_run-1_PD.nii.gz   2014-06-29T00:00:00</span></font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><font color="#000000" face="Menlo"><span style="font-size:11px">anat/sub-ANOM_ses-endoftreatment_run-1_T2w.nii.gz  2014-06-29T00:00:00</span></font></div>
</div>
</div>
<div>=== </div>
<div><br>
<blockquote type="cite">
<div>On Jul 15, 2021, at 5:23 PM, Cecile Madjar <<a href="mailto:cecile.madjar@mcin.ca" target="_blank">cecile.madjar@mcin.ca</a>> wrote:</div>
<br>
<div>
<p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p>
<div><br>
</div>
<div dir="ltr">
<div>Hi Alfredo,</div>
<div><br>
</div>
<div>Sorry for the delay, I had to take a deeper look at the code to answer some of your questions. See below.</div>
<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> 1. I added the file sub-<label>[_ses-<label>]_scans.tsv as suggested in the BIDS standard (<a href="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" rel="noreferrer" target="_blank">https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#scans-file</a>)
 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?<br>
</blockquote>
<div><br>
</div>
<div>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.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> 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?<br>
</blockquote>
<div><br>
</div>
<div>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
<a href="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" target="_blank">
this part</a> 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
<a href="https://secure-web.cisco.com/1Tpg7v8DtF0HJJEnPZUNGN7gwCdF7vLrM19WZmYU8p4-riYcbJ1FVNYH0FGEvIBT0KwSYUMgtVeulxeEaGSohphmm0NQn8wIbxh5cSX4VwbKcKLhvQY1RtnS2SxEKUi4Pln5KHxRYDcVhz9sWnZ6EIhfZEDECvkuT2-zTt24B5MMeBduiQG8W3Pqa7Qr2oEjJW_m84bq0EVtbGQmu5ZVKytj8tPkwWAUE8gTEtLOb1DjwDX5O8y8EHAN_8lf2ZqJ9eojMRDufJj2QObf0g02n3Q/https%3A%2F%2Fgithub.com%2Faces%2FLoris-MRI%2Fpull%2F645" target="_blank">
https://github.com/aces/Loris-MRI/pull/645</a>.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> 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?<br>
</blockquote>
<div><br>
</div>
<div>Yes, the pipeline is supposed to be smart enough to not reinsert something that was previously inserted. </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> 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:<br>
> <br>
> ===<br>
> [Mon Jul 12 12:05:37.705967 2021] [php7:error] [pid 14497] [client <a href="http://secure-web.cisco.com/1WYhYdfRTqaTteJ_4rndbHmww7uTfLympsocUwkjHV2oHQVOQ_ddIjv7AcfCoiP5cJIbw5iksCEFI9RVOxA3_lM6etO-PCaDz89PgNjaEjQPMC5dEfLOft3B7YhP7TCF4ISn-hvCOCFnhQqmRbs9zS1PRbVr6qe_Fra0AR2dZzskzHnYp2A_u29fTzE5u8vYJLMpl4t10wah4Bga-hhoD3gkgnRHVU5KAWy4uwX30Ma4tng8DnVlqBopiM9DpYE6ZEviZpdmHvWqJZxPHxbnHOw/http%3A%2F%2F216.15.126.108%3A55424" rel="noreferrer" target="_blank">
216.15.126.108:55424</a>] PHP Fatal error:  Uncaught TypeError: Return value of Utility::getStageUsingCandID() must be of the type string, null returned in /var/www<br>
> /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(<br>
> 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<br>
> 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<br>
> 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(<br>
> 137): NDB_Page->pro in /var/www/loris/php/libraries/Utility.class.inc on line 632, referer:
<a href="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" rel="noreferrer" target="_blank">
https://ipmsa-loris.bic.mni.mcgill.ca/candidate_profile/207019/</a><br>
> ===<br>
</blockquote>
<div><br>
</div>
<div>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: <a href="https://secure-web.cisco.com/1RuRCEtVgtWrK7Pm95g10P8zRltmw5fqwt4wM4vzTM2N7zp7p8HXJKNSQo5QSAfOa23ID04z8m13DojdlnneipDRp6yoYNUJIoorexU5ixp49Alwi5aaHokrOmz-gRnpRkrUxMNI04i2tsCDBAsyiwIBoMwgWyCGHg8asEvLiHrEcYtWAdRycS4UQ7Udt6hrVhp6DqF6kpBH3s4oWPPlFvnJ9CHywNOno0NqHI0zXVnlWI2BuIW0heLJeaDSyrvK-5FcYxqhfnBEJTq1hkNB-Jg/https%3A%2F%2Fgithub.com%2Faces%2FLoris-MRI%2Fpull%2F644" target="_blank">https://github.com/aces/Loris-MRI/pull/644</a> </div>
<div><br>
</div>
<div>Hope this helps,</div>
<div><br>
</div>
<div>Cécile</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<div>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 <a href="http://www.massgeneralbrigham.org/complianceline" target="_blank">http://www.massgeneralbrigham.org/complianceline</a> . 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.</div><br>
<p class="MsoNormal">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.  </p></div>

</blockquote></div>