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

PET HRRT insertion pipeline #524

Merged
merged 27 commits into from
Mar 12, 2021
Merged

Conversation

cmadjar
Copy link
Collaborator

@cmadjar cmadjar commented Feb 27, 2020

New dependencies:

sudo cpan install Digest::BLAKE2
sudo cpan install File::Type
sudo cpan install String::ShellQuote

Note for projects using the MNI HRRT PET scanner:

If you are acquiring datasets using the MNI HRRT PET scanner, ensure that:

  • when running HRRT_PET_insertion.pl, the option -bic. Note, the flag is automatically set on the call to HRRT_PET_insertion.pl from imaging_upload_file.pl based on the number of files that contains the BIC string for the moment.
  • ensure to add the following function to your profile file (typically called prod, see dicom-archive/profileTemplate.pl for example)
sub determineHRRTprotocol {
    my ( $protocol, $ecat_file ) = @_;

    $protocol =~ s/'|\\|_|"|\s//g; # remove weird characters from protocol name

    if ( $ecat_file =~ /Dfbp/i ) {
        $protocol .= "FBP"; # add FBP reconstruction to filename
    } else {
        $protocol .= "OSEM"; # add OSEM reconstruction to filename
    }

    if ( $ecat_file =~ /_MC01/i ) {
        $protocol .= "mc"; # add mc acronym for motion corrected datasets
    }

    return $protocol;
}
  • to add the proper scan type to the table mri_scan_type based on the information present in the PROTOCOL variable of the Matlab file of the BIC HRRT study. Example: for an acquisition acquired using the PROTOCOL F18_NAV_6fr the following scan types need to be created based on the reconstruction technique (OSEM or FBP) and whether motion correction was applied to the image or not:
    • F18NAV6frOSEM: OSEM (Ordered Suspect Expectation Maximization) reconstruction
    • F18NAV6frFBP: FBP (Filter Back Projection) reconstruction
    • F18NAV6frOSEMmc: OSEM reconstruction and motion correction applied
    • F18NAV6frFBPmc: FBP reconstruction and motion correction applied

Issues and link to other PRs

cmadjar added 13 commits March 9, 2020 11:25
minc_insertion.pl  -profile prod -mincPath/data/incoming/preventAD/MTL0661_603347_PREPT00_NAV_small/MTL0661_603347_PREPT00-NAV-HRRT1030-2017.3.16.12.3.14_EMMASK_3D.mnc -acquisition_protocol F18NAV6frOSEM -bypass_extra_file_checks
Then need to:
  - find a way to link the ecat data in parameter file
  - call mass_pic.pl
  - call mass_jiv.pl
  - implement an ImagingUpload function that calls HRRT_PET_insertion.pl with proper argument (included set BIC flag)
  - proper logging and exit codes
  - clean up the todo item
	modified:   HRRT_PET_insertion.pl
	modified:   NeuroDB/HRRTSUM.pm
Inserting MINC file from HRRT scanner into the database

minc_insertion.pl working. Left to add a link from files to hrrt_archive. SQL modified, need to modify the scripts in consequence.

Adding HrrtArchiveID into the files table and adding a link to the ecat file into the parameter_file table

Making that all call to modified functions with upload_id instead of archive source location are modified to include $upload_id

Instead of using getUploadIDUsingTarchiveSrcLoc for all functions of MRIProcessingUtility, passing the uploadID to those functions to simplify the code

Update hrrt_archive and mri_upload tables at the end of HRRT_PET_insertion.pl execution

Fixed a conflict badly resolved and uncommented big part of the script that were commented for testing

A few more changes to the HRRT_PET_insertion.pl script

incorporating the exit codes into the PET pipeline

Fixing one of the exit code and adding description for the new script

Removed columns from hrrt_archive and modified hash technic from MD5 to BLAKE2

Changed the way we identify the uploaded study is from an HRRT scanner

Removed the modality from the Schema changes

Fixing the exit codes for imaging_upload_file.pl and ImagingUpload.pm

Solved exit code duplication, removed extra print and change mod of HRRT_PET_insertion.pl so can be called from imaging_upload_file.pl

remove unrelated changes due to rebase

remove unrelated changes due to rebase

cleanup

finished cleanup of rebase hopefully

finished cleanup of rebase hopefully

moved some functions to HRRT

a few improvements

modifed the profileTemplate.pl

fixed a bug in mri_upload update

fix bug in imaging upload

fixed a few bugs
@cmadjar cmadjar requested a review from nicolasbrossard March 9, 2020 20:28
@cmadjar cmadjar changed the base branch from master to main July 21, 2020 13:47
driusan pushed a commit to aces/Loris that referenced this pull request Jul 21, 2020
…6142)

This updates the SQL schema to include the new PET HRRT archive tables and their link to the already existing imaging tables for Loris-MRI.

See also: aces/Loris-MRI#524, aces/Loris-MRI#480
spell00 pushed a commit to spell00/Loris that referenced this pull request Aug 13, 2020
…ces#6142)

This updates the SQL schema to include the new PET HRRT archive tables and their link to the already existing imaging tables for Loris-MRI.

See also: aces/Loris-MRI#524, aces/Loris-MRI#480
@laemtl laemtl force-pushed the PetHrrtInsertion_rebase branch from cebbf46 to 154608e Compare February 19, 2021 19:14
@cmadjar cmadjar added this to the 24.0.0 milestone Feb 19, 2021
@laemtl laemtl self-requested a review February 24, 2021 17:38
@laemtl
Copy link
Contributor

laemtl commented Feb 24, 2021

I tested the PET pipeline with success.

@laemtl laemtl removed the Blocked Merge it and you die label Feb 24, 2021
@cmadjar cmadjar merged commit 7c46cac into aces:main Mar 12, 2021
@cmadjar cmadjar deleted the PetHrrtInsertion_rebase branch May 6, 2021 18:16
AlexandraLivadas pushed a commit to AlexandraLivadas/Loris that referenced this pull request Jun 15, 2021
…ces#6142)

This updates the SQL schema to include the new PET HRRT archive tables and their link to the already existing imaging tables for Loris-MRI.

See also: aces/Loris-MRI#524, aces/Loris-MRI#480
AlexandraLivadas pushed a commit to AlexandraLivadas/Loris that referenced this pull request Jun 29, 2021
…ces#6142)

This updates the SQL schema to include the new PET HRRT archive tables and their link to the already existing imaging tables for Loris-MRI.

See also: aces/Loris-MRI#524, aces/Loris-MRI#480
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants