Skip to content
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

Imaging Browser: Add DICOM download: Redmine 12580 #3501

Merged

Conversation

MounaSafiHarab
Copy link
Contributor

@MounaSafiHarab MounaSafiHarab commented Feb 19, 2018

Projects can download the .tar that includes raw (DICOM) images, as well as .log and .meta (some meta data related to the insertion progress)

  1. One .tar per candidate per visit:
    downloaddicom

  2. Two .tar per candidate (example here illustrated becaus2 the candidate had to repeat a specific sequence another day, but under the same visit):
    updatedimagbrowserscreenshottwotars

@kongtiaowang kongtiaowang added the Passed manual tests PR has been successfully tested by at least one peer label Feb 20, 2018
@MounaSafiHarab MounaSafiHarab added the Category: Feature PR or issue that aims to introduce a new feature label Feb 21, 2018
Copy link
Contributor

@christinerogers christinerogers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 suggestions for the documentation

Also... revision to the Imaging Browser Spec? (if/when merged?)

@@ -11,7 +11,7 @@

### B. ViewSession / Volume List

8. Sidebar: all links work
8. Sidebar: all links work, inlcuding the Download DICOM option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • typo: inlcuding -> including
  • If there are multiple tars, they should be listed (and download on each should work)

Copy link
Contributor Author

@MounaSafiHarab MounaSafiHarab Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

  1. typo fixed! thanks
  2. yes, this should work; I tested it as we had a case in CCNA wwhich had its initial MRi visit split into two scanning sessions and the changes here work as well. I fixed the screenshot at the beginning of the pull request to show this case.
  3. re. your earlier comment on specs; I had already updated those in an earlier commit before you made the comment; is it not sufficient what I wrote?

foreach ($qresult as $k=>$v) {
$tarchiveID = $v['TarchiveID'];
$tarIDToTarLoc[$tarchiveID] =$v['ArchiveLocation'];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest using array_values() instead of foreach. Prevent unused variable $k.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unused $k. thanks!

@davidblader davidblader added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Feb 26, 2018
@davidblader
Copy link
Contributor

needs rebase

@MounaSafiHarab MounaSafiHarab removed the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Feb 26, 2018
@MounaSafiHarab
Copy link
Contributor Author

MounaSafiHarab commented Feb 26, 2018

needs rebase

I just did now that PR #3500 is merged.

@driusan driusan modified the milestones: 19.1, 19.2 Feb 28, 2018
Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MounaSafiHarab I tried it on a dataset with the existing archive and it worked like a charm!

I also tried it on a dataset that did not have a correct path to the archive and got this page:
screen shot 2018-03-05 at 2 06 18 pm

@driusan, @MounaSafiHarab could it be possible to send a warning that the file cannot be found instead of the error page? It would look cleaner.

@@ -78,7 +78,10 @@ mantis_url - This setting defines a URL for LORIS to include a link to for bug r
`$LORIS/tools/CouchDB_Import_MRI.php` alongside all other CouchDB
import scripts, but should logically be considered part of this module.)
- The imaging browser module includes links to BrainBrowser to visualize data.
- The control panel on the viewsession page includes links to instruments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would tend to right "View Session" page

Copy link
Contributor Author

@MounaSafiHarab MounaSafiHarab Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, changed in in the 5 occurrences

- The control panel on the viewsession page includes links to the instruments
as configured by the study.
- The control panel on the viewsession page includes links to the DICOM Archive
for any DICOM tars associated with the given session.
- The control panel on the viewsession page includes links to the DICOM Archive
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, "View Session" instead of viewsession

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@MounaSafiHarab
Copy link
Contributor Author

@driusan, @MounaSafiHarab could it be possible to send a warning that the file cannot be found instead of the error page? It would look cleaner.

perfectly valid point, but just to be clear, this is the same error you get if you try to download a MINC file that does not exist (see below).
getfileminc

it is in the get_file, in the section that handles the file non-existent condition:
if (!file_exists($FullPath)) { error_log("ERROR: File $File does not exist"); header("HTTP/1.1 404 Not Found"); exit(5); }

So not sure I should change it here, or this is the subject of another pull request....

@cmadjar
Copy link
Collaborator

cmadjar commented Mar 5, 2018

@MounaSafiHarab I agree with you, it should probably be a separate ticket. Do you want to create a redmine ticket for it? In the meantime, I'll approve your PR :). Thanks!

cmadjar
cmadjar previously approved these changes Mar 5, 2018
Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice work :)

PapillonMcGill
PapillonMcGill previously approved these changes Mar 6, 2018
@MounaSafiHarab
Copy link
Contributor Author

@MounaSafiHarab I agree with you, it should probably be a separate ticket. Do you want to create a redmine ticket for it? In the meantime, I'll approve your PR :). Thanks!

Done, Redmine #14029

@@ -92,6 +94,12 @@
exit(4);
}

// If $File contains "DCM_", prefix automatically inserted by the
// LORIS-MRI pipeline, identify it as $FileExt: "DICOMTAR"
if (strpos($File, "DCM_") ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing === 0. The comment should also point out that it's a hack, since there's no such thing as a DICOMTAR extension.

Copy link
Contributor Author

@MounaSafiHarab MounaSafiHarab Mar 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@driusan
you can not assume the DCM is at the beginning of the filename. It used to be the case, but not anymore (now the file stored within a year directory, followed by the filename which then starts with DCM_), so in the tarchive table, a typical ArchiveLocation is:
2016/DCM_2016-09-13_ImagingUpload-9-50-abCD77.tar

but I updated the comment as you requested

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, it still needs !== false to differentiate from finding at the 0 index vs not finding in the string at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, done!

@MounaSafiHarab MounaSafiHarab dismissed stale reviews from PapillonMcGill and cmadjar via ed1b8b4 March 23, 2018 15:49
@ridz1208 ridz1208 removed the Passed manual tests PR has been successfully tested by at least one peer label Mar 27, 2018
@ridz1208
Copy link
Collaborator

@kongtiaowang too many changes after you tested, please test again

@cmadjar cmadjar added the Passed manual tests PR has been successfully tested by at least one peer label Apr 9, 2018
cmadjar
cmadjar previously approved these changes Apr 9, 2018
Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Just tested on my sandbox and it works perfectly aside from when the file does not exist in the filesystem, problem which will be resolved in a separate PR as discussed with @MounaSafiHarab.

PapillonMcGill
PapillonMcGill previously approved these changes Apr 9, 2018
Copy link
Contributor

@PapillonMcGill PapillonMcGill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@driusan driusan dismissed their stale review April 9, 2018 15:31

stale review

$tarIDToTarLoc =array();
foreach ($qresult as $v) {
$tarchiveID = $v['TarchiveID'];
$tarIDToTarLoc[$tarchiveID] =$v['ArchiveLocation'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this passed PHPCS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know;
I added an extra space after the = sign, so it is a manual change; and this passes phpcs if this was your main concern (I still do not know how it passed before)
not sure if the other issue is also the line before where the == is not aligned with the line underneath it, but when I did force it to manually be aligned with the line below, it actually gave me phpcs error!

@MounaSafiHarab MounaSafiHarab dismissed stale reviews from PapillonMcGill and cmadjar via 821b78a April 17, 2018 17:33
@MounaSafiHarab
Copy link
Contributor Author

MounaSafiHarab commented Apr 17, 2018

@nicolasbrossard

I addressed your comments on @davidblader PR (#2967) here for the get_file.php
which incidentally could also address one of @driusan's earlier comments on this pull request (for checking the beginning of the filename starting with DCM now that I added the basename).

@cmadjar removed your passed manual test tag because I added a couple of commits based on comments.

@MounaSafiHarab MounaSafiHarab removed the Passed manual tests PR has been successfully tested by at least one peer label Apr 17, 2018
@ridz1208 ridz1208 removed this from the 19.2 milestone Apr 18, 2018
cmadjar
cmadjar previously approved these changes Apr 23, 2018
Copy link
Collaborator

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!! 😀

PapillonMcGill
PapillonMcGill previously approved these changes Apr 23, 2018
@MounaSafiHarab MounaSafiHarab dismissed stale reviews from PapillonMcGill and cmadjar via 1cfb14b April 25, 2018 17:44
@MounaSafiHarab
Copy link
Contributor Author

I rebased this on minor since PR #2967 has been merged, so I do not need the get_file anymore...

is there anything else this PR is waiting on?
@davidblader @driusan @PapillonMcGill @cmadjar ?

@driusan driusan merged commit 3d7650e into aces:minor May 16, 2018
@ridz1208 ridz1208 added this to the 19.3 milestone May 18, 2018
@ridz1208 ridz1208 modified the milestones: 19.3, 20.0 Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Feature PR or issue that aims to introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants