<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">Hi Alfredo,
<div><br>
</div>
<div>Great, this is helpful to know. If I understand you - the filename is the same for all the packages of processed data you are trying to upload, for various subject-visits. </div>
<div>
<div>e.g. you may have organized them in subdirectories like: $subject/$visit/processed_data.gz </div>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">One solution could be to make a copy with a different name before uploading.</span></blockquote>
<div><br>
</div>
<div>Instead of making a copy (or renaming) -- try a unique soft-link for each package. I should think that would work (though can't confirm right now).</div>
<div>e.g. Use a simple bash command to execute for each package: <br>
</div>
<div>> ln -s $subject/$visit/processed_data.gz ./$subject_$visit_processed_data.gz</div>
<div>(then tell the pipeline to load each $subject_$visit_processed_data.gz )</div>
<div><br>
</div>
<div>Again, this no-duplicate check exists to help ensure duplicate data isn't inserted, which is a protection we try to preserve as much as possible. </div>
<div>Since all the code is customizable, this check could be manually bypassed, but ideally this workaround will help keep the error-proofing intact. </div>
<div><br>
</div>
<div>Let us know how this goes - </div>
<div>We'll be offline for Labour day weekend but back in the office next Tuesday.</div>
<div>Best, </div>
<div>Christine </div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Aug 30, 2019 at 12:53 PM 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 dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Christine,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thank you for your answer.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here are the answers to your questions:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="color:rgb(50,49,48);background-color:rgb(255,255,255);display:inline">Can you use distinct filenames ?</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">We could but we already have all the images, thousands, with a pre-defined convention. One solution could be to make a copy with a different name before
uploading.</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline"><span style="color:rgb(50,49,48);background-color:rgb(255,255,255);display:inline">Are you are trying to load additional data for a participant session
(i.e. same IDs and visit label) ? </span><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">Yes, we are uploading the result of a couple of pipelines for each participant for each label. </span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Let me know if you can find a workaround, in the mean time I will check with Pisti if we can make a copy of the files with a different name before uploading.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Alfredo.</div>
<div id="gmail-m_-6047471355801804185Signature">
<div class="gmail-m_-6047471355801804185BodyFragment"></div>
</div>
<div id="gmail-m_-6047471355801804185appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-6047471355801804185divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Christine Rogers, Ms. <<a href="mailto:christine.rogers@mcgill.ca" target="_blank">christine.rogers@mcgill.ca</a>><br>
<b>Sent:</b> Friday, August 30, 2019 11:17 AM<br>
<b>To:</b> Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@BWH.HARVARD.EDU" target="_blank">AMORALESPINZON@BWH.HARVARD.EDU</a>><br>
<b>Cc:</b> <a href="mailto:loris-dev@bic.mni.mcgill.ca" target="_blank">loris-dev@bic.mni.mcgill.ca</a> <<a href="mailto:loris-dev@bic.mni.mcgill.ca" target="_blank">loris-dev@bic.mni.mcgill.ca</a>>; Cecile Madjar <<a href="mailto:cecile.madjar@mcin.ca" target="_blank">cecile.madjar@mcin.ca</a>>;
Sridar Narayanan, Dr. <<a href="mailto:sridar.narayanan@mcgill.ca" target="_blank">sridar.narayanan@mcgill.ca</a>>; Rozie Arnaoutelis, Ms. <<a href="mailto:rozie.arnaoutelis@mcgill.ca" target="_blank">rozie.arnaoutelis@mcgill.ca</a>>; Douglas Arnold, Dr. <<a href="mailto:douglas.arnold@mcgill.ca" target="_blank">douglas.arnold@mcgill.ca</a>>;
Guttmann, Charles,M.D. <<a href="mailto:guttmann@bwh.harvard.edu" target="_blank">guttmann@bwh.harvard.edu</a>><br>
<b>Subject:</b> Re: [Loris-dev] Error "not a unique file" inserting segmentation files in LORIS</font>
<div> </div>
</div>
<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>
<p></p>
<div dir="ltr">Hi Alfredo,
<div><br>
</div>
<div>
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Could you please help me inserting those files which are different in size and md5 from previous uploaded files?
</blockquote>
<div> </div>
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The only similarity between the previous uploaded files and the ones that could not be uploaded is the filename.</blockquote>
<div><br>
</div>
To provide a quick answer (since most of our imaging team is on vacation this week) : </div>
<div><br>
</div>
<div>
<div>Yes the MD5hash seems to require a unique filename (* below).</div>
</div>
<div>
<div>Can you use distinct filenames ? i.e. Are you are trying to load additional data for a participant session (i.e. same IDs and visit label) ? </div>
<div>Or, are you trying to load more than one participant/session at a time? </div>
</div>
<div><br>
</div>
<div>(*) This line in the actual <a href="https://github.com/aces/Loris-MRI/blob/master/uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm#L617" target="_blank">
MRIProcessingUtility library</a>: (around Line 617)<br>
</div>
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-6047471355801804185x_gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap">$md5hash</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)">
= &NeuroDB::MRI::compute_hash(\</span><span class="gmail-m_-6047471355801804185x_gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap">$file</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)">);</span></blockquote>
<div>and
<table class="gmail-m_-6047471355801804185x_gmail-highlight gmail-m_-6047471355801804185x_gmail-tab-size gmail-m_-6047471355801804185x_gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;border-spacing:0px;color:rgb(36,41,46);font-size:14px">
<tbody style="box-sizing:border-box">
<tr style="box-sizing:border-box">
</tr>
<tr style="box-sizing:border-box">
<td id="gmail-m_-6047471355801804185x_gmail-LC622" class="gmail-m_-6047471355801804185x_gmail-blob-code gmail-m_-6047471355801804185x_gmail-blob-code-inner gmail-m_-6047471355801804185x_gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;overflow:visible;white-space:pre-wrap">
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-6047471355801804185x_gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">my</span>
<span class="gmail-m_-6047471355801804185x_gmail-pl-smi" style="box-sizing:border-box">
$unique</span> = &NeuroDB::MRI::is_unique_hash(\<span class="gmail-m_-6047471355801804185x_gmail-pl-smi" style="box-sizing:border-box">$file</span>);</blockquote>
</td>
</tr>
<tr style="box-sizing:border-box">
</tr>
</tbody>
</table>
</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>I'll check with other imaging devs to see if we have a workaround while our senior devs are away -- I think there must be some solution... </div>
<div>
<div>Meanwhile, the MD5hash for imaging files is documented here (<a href="https://github.com/aces/Loris-MRI/blob/21.0-dev/docs/scripts_md/MRIProcessingUtility.md#computemd5hashfile-upload_id" target="_blank">per this script documentation</a>) : </div>
<div><br>
</div>
</div>
<div>
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
computeMd5Hash($file, $upload_id)<br>
Computes the MD5 hash of a file and makes sure it is unique.<br>
INPUTS:
<ul style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;padding-left:2em;color:rgb(36,41,46);font-size:16px">
<li style="box-sizing:border-box">$file : file to use to compute the MD5 hash</li></ul>
<ul style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;padding-left:2em;color:rgb(36,41,46);font-size:16px">
<li style="box-sizing:border-box;margin-top:0.25em">$upload_id: upload ID of the study</li></ul>
RETURNS: 1 if the file is unique, 0 otherwise</blockquote>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>Best, </div>
<div>Christine </div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail-m_-6047471355801804185x_gmail_quote">
<div dir="ltr" class="gmail-m_-6047471355801804185x_gmail_attr">On Thu, Aug 29, 2019 at 9:46 PM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu" target="_blank">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br>
</div>
<blockquote class="gmail-m_-6047471355801804185x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
</div>
<span>Dear DevLoris Team,<br>
</span>
<div><br>
</div>
<div>I started the uploading process of processed files, segmentations and transformations, using the file "<a href="http://register_processed_data.pl" target="_blank">register_processed_data.pl</a>" but some files are not being uploaded. The error reported
in "data/logs/registerProcessed" show the following log for one of the files that could not be inserted:<br>
</div>
<div><br>
</div>
<div>-------------------------------------------------------------------------------<br>
</div>
<div>==> Successfully connected to database <br>
</div>
<div>Log file, 2019-08-29_19:08:17<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>==>Mapped DICOM parameters<br>
</div>
<div> -> using user-defined filterParameters for /xxx/w024/gvf_ISPC-stx152lsq6.mnc.gz<br>
</div>
<div><br>
</div>
<div>==> Verifying acquisition center<br>
</div>
<div> - Center Name : UNKN<br>
</div>
<div> - CenterID : 0<br>
</div>
<div> -> Set ScannerID to 0.<br>
</div>
<div><br>
</div>
<div>==> Data found for candidate : 123456 - Visit: w024<br>
</div>
<div> -> Set SessionID to 28269.<br>
</div>
<div> -> Set SourceFileID to 49598.<br>
</div>
<div> -> Set AcquisitionProtocolID to 1013.<br>
</div>
<div> -> Set CoordinateSpace to stx152lsq6.<br>
</div>
<div> -> Set SourcePipeline to ConsensusGd.<br>
</div>
<div> -> Set PipelineDate to 2019-08-29.<br>
</div>
<div> -> Set OutputType to gvf.<br>
</div>
<div> -> Set md5hash to <span style="color:rgb(200,38,19)"><b>b877648ed0ef9a7458ad4931f4dbfd11</b></span>.<br>
</div>
<div><br>
</div>
<div>==> NeuroDB::File=HASH(0x136baa8) is not a unique file and will not be added to database.<br>
</div>
<div>-------------------------------------------------------------------------------<br>
</div>
<div><br>
</div>
<div>I checked the md5hash for a previous uploaded file, which is different from the previous, but the same "md5hash" was calculated. See the following log:<br>
</div>
<div><br>
</div>
<div>-------------------------------------------------------------------------------<br>
</div>
<div><br>
</div>
<div>==> Successfully connected to database <br>
</div>
<div>Log file, 2019-08-19_10:11:53<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>==>Mapped DICOM parameters<br>
</div>
<div> -> using user-defined filterParameters for <br>
</div>
<div><br>
</div>
<div>==> Verifying acquisition center<br>
</div>
<div> - Center Name : UNKN<br>
</div>
<div> - CenterID : 0<br>
</div>
<div> -> Set ScannerID to 0.<br>
</div>
<div><br>
</div>
<div>==> Data found for candidate : 123456 - Visit: baseline<br>
</div>
<div> -> Set SessionID to 28268.<br>
</div>
<div> -> Set SourceFileID to 49593.<br>
</div>
<div> -> Set AcquisitionProtocolID to 1013.<br>
</div>
<div> -> Set CoordinateSpace to stx152lsq6.<br>
</div>
<div> -> Set SourcePipeline to T2Vol.<br>
</div>
<div> -> Set PipelineDate to 2019-08-19.<br>
</div>
<div> -> Set OutputType to gvf.<br>
</div>
<div> -> Set md5hash to <span style="color:rgb(200,38,19)"><b>b877648ed0ef9a7458ad4931f4dbfd11</b></span>.<br>
</div>
<div>File /xxx/baseline/gvf_ISPC-stx152lsq6.mnc.gz <br>
</div>
<div> moved to:<br>
</div>
<div> /yyy/data/assembly/123456/baseline/mri/processed/T2Vol/IPMSA_123456_baseline_t1c_001_gvf_001.mnc.gz<br>
</div>
<div><br>
</div>
<div>==> FAILED TO INSERT INTERMEDIARY FILES FOR 112945!<br>
</div>
<div><br>
</div>
<div>Making JIV<br>
</div>
<div><br>
</div>
<div> ==> Registered /data_/ipmsa/loris_data/IPMSA/data/assembly/307024/baseline/mri/processed/T2Vol/IPMSA_307024_baseline_t1c_001_gvf_001.mnc.gz in database, given FileID: 112945<br>
</div>
<div>-------------------------------------------------------------------------------<br>
</div>
<div><br>
</div>
<div>Here are the corresponding md5 for each file calculated using the command md5sum:<br>
</div>
<div>/xxx/w024/gvf_ISPC-stx152lsq6.mnc.gz 7306010346c4614d8e338595b386ca5c<br>
</div>
<div>/xxx/baseline/gvf_ISPC-stx152lsq6.mnc.gz 22107253f8b87c9918ac7f82fdc22c36<br>
</div>
<div><br>
</div>
<div>Could you please help me inserting those files which are different in size and md5 from previous uploaded files? The only similarity between the previous uploaded files and the ones that could not be uploaded is the filename.</div>
<div><br>
</div>
<div>Let me know if you need more information.<br>
</div>
<div><br>
</div>
<div>Regards,<br>
</div>
<div>Alfredo.<br>
</div>
<div><br>
</div>
<span></span>
<div id="gmail-m_-6047471355801804185x_gmail-m_-9176187950921327585Signature">
<div class="gmail-m_-6047471355801804185x_gmail-m_-9176187950921327585BodyFragment">
<font size="2"><span style="font-size:10pt">
<div class="gmail-m_-6047471355801804185x_gmail-m_-9176187950921327585PlainText">
</div>
</span></font></div>
</div>
<p></p>
<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p>
</div>
_______________________________________________<br>
Loris-dev mailing list<br>
<a href="mailto:Loris-dev@bic.mni.mcgill.ca" target="_blank">Loris-dev@bic.mni.mcgill.ca</a><br>
<a href="https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev" rel="noreferrer" target="_blank">https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail-m_-6047471355801804185x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><br>
<a href="mailto:christine.rogers@mcgill.ca" target="_blank">christine.rogers@mcgill.ca</a><br>
McGill Centre for Integrative Neuroscience | MCIN.ca</div>
<div>Montreal Neurological Institute</div>
<div>McGill University | Montreal | Canada</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Loris-dev mailing list<br>
<a href="mailto:Loris-dev@bic.mni.mcgill.ca" target="_blank">Loris-dev@bic.mni.mcgill.ca</a><br>
<a href="https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev" rel="noreferrer" target="_blank">https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><br>
<a href="mailto:christine.rogers@mcgill.ca" target="_blank">christine.rogers@mcgill.ca</a><br>
McGill Centre for Integrative Neuroscience | MCIN.ca</div>
<div>Montreal Neurological Institute</div>
<div>McGill University | Montreal | Canada</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>