-
Notifications
You must be signed in to change notification settings - Fork 51
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
[ImagingUpload.pm] Look inside file type and not file path for the word dicom #178
Conversation
@@ -417,7 +417,8 @@ sub isDicom { | |||
my $this = shift; | |||
my ($dicom_file) = @_; | |||
my $cmd = "file $dicom_file"; | |||
my $file_type = `$cmd`; | |||
my $cmd_log = `$cmd`; | |||
my ($file_path, $file_type) = split /:/, $cmd_log; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match on last DICOM medical imaging data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DICOM medical imaging data$
works; scripts fail now at the isDicom check step as opposed to the PatientName extraction step (see messages I get below). but can you please change the description above? a .DS_Store file would not go through this check in the first place (check line 190). I am guessing you tested this before merging the pull request that excludes the .DS_Store from the check. With my tests, here is what I get withOUT your changes: and WITH your change |
try |
* Initial import of files from http://code.google.com/p/dicom-archive/ * add two configurable options is_site and is_sge * Added new getIncomingDir config function * Added missing semi-colons. * Modifies the temporairy values of $data_dir, $get_dicom_info and $mail_user variables * Places back the forward slash in the email-address * Modifies the temporairy value for the tarchive_librairy location * Modified the tarchivelibdir temp value * Set the if_sge to false by default * Fixed the dcmodify --insert-tag option to --insert (option used in more recent dcmodify). * Updates the mri_upload table * Includes option to update the mri_upload table * Modification to the profileTemplate to be able to use DTIPrep pipeline * Added get_DTI_Site_CandID_Visit function in profile file * Cosmetic changes * Cosmetic changes * Fixed typos and indentation * Correct spelling mistakes * 1) added the functionality to insert the extension , 2) fixed indentation * Removed the filetype option * Changed the queries to use the prepared statements * Modified $d to $dir in profileTemplate * Remove .DS_Store file from DICOM source directory before creating new object. Other fails while reading content of dcm source directory * Modified getSubjectIDs so that it uses PatientName instead of PatientID lookupCenterID using patient name instead of PatientID * modified: profileTemplate * Moved reference to ~/.neurodb to .loris_mri directory * Some more files * Replaced .neurodb by .loris_mri in updateHeaders.pl * Removed the full path * DicomTar.pl should use proper $profile name instead of prod * Sometime DICOM Header may not have Invertion Time field (0018,9079). Set Inversion Time to 0 in tarchive_series to avoid error message: DBD::mysql::st execute failed: Data truncated for column 'InversionTime' * DICOM HEADER may not have Inversion time (0018,9079) set which cause tarchives_series sql table who expect a double to receive an empty string. * THIS IS A DUPLICATE from opionnalProfileFixInDicomTar pull request please ignore change in dicomTar.pl THIS IS A DUPLICATE from opionnalProfileFixInDicomTar pull request please ignore change in dicomTar.pl * removed useless numbers * Added $subjectID{'createVisitLabel'} option to profile template. * Changed $subjectID{'createVisitLabel'} type to boolean * added exit 0 at the end of the file * cosmetic change * Added a new option config $bin_dir * Fixed the option * Defined(@array) is deprecated. Removed error message on the console defined(@array) is deprecated at... (Maybe you should just omit the defined()?) * Removed all occurences of defined(@array). * replaced the sourcelocation column by DecompressedLocation * Added functionality to insert PET DICOMs in tarchive tables. * Fixed indentation in the pull request. * NIfTI support of the imaging pipeline (profileTemplate change). * Added -centerName option in call to dicomTar.pl. * Made ArchiveLocation relative in tarchive table. * Created a MySQL scripted patch to make ArchiveLocation in the tarchive table relative. * Added functionality to print query on one line. * Cleaned up and prepared statement for queries in main directory of dicom-archive-tools * Prepared mysql statement for DCMSUM.pm * Fixed bug inserted while integrating mysql prepare statements * Removed the Deprecated definition of array: !@Settings instead of !defined @Settings, to be in line with pull request #95 * One more consistency check on verbose and notification spool tables * One more explicit Done message * Fixes the insert in DCMSUM.pm so it does not set the creatinguser field in the tarchive table to NULL when the pipeline is run in auto-launch mode. * site or rather, study, no longer hard coded * removed extra ~ and the comments as per Cecile feedback * adding TarchiveSeriesID to the tarchive_files * Added the getSNRModalities function * added flair * typo * typo AGAIN * added comment based on SeriesUID and EchoTime * Removed getIncomingDir routine from profileTemplate; it is no longer used. Same as PR35 * Revert "adding TarchiveSeriesID to the tarchive_files" * isFileToBeRegisteredGivenProtocol in Profile now returns 1 if ne unknown * Incorporate comment of Dave * I cna not type wihtout making typos * re-adding TarchiveSeriesID to the tarchive_files * swap inserts * added comment * updated the comment with tarchive_files * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 (#182) * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 * went through all the files that get the settings from the prod file * added the install scripts * removed prefix from the Get_DTI_Site function * added data_dir as projects like IBIS could have it different from mincPath * Greg feedback on DB::DBI, removal of defined, and a masked variable declaration * added the script for existing projects to populate their default database values with those from their prod file * function return value * IBIS has all sorts of differences, the updates in this commit account for those * data_dir renamed to dataDirBasepath * Cecile feedback and applying her comments to all other files * fixed the message where the values is kept at its default, and removed debug print * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 (#45) * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 * went through all the files that get the settings from the prod file * removed prefix from the Get_DTI_Site function * consistency in DB versus NeuroDB * one dollar sign instead of 2; but have no clue why * Cecile required changes * [ImagingUpload.pm] Look inside file type and not file path for the word dicom (#178) * Look inside file type and not file path for the word dicom * check for the whole dicom type string * spaces * spaces * Fix file count in mri_upload when deleting a minc file and then re-inserting (#180) * fixed minc deletion (#185) * Remove all .DS_Store files anywhere in the tree, and __MACOSX directory (#46) * Remove all .DS_Store files anywhere in the tree * The command will not complain even if it does not find a file to delete. * Incorporate the additional changes from Mouna * Removed files starting with . and __MACOSX directory from the uploaded scans: Redmine 11670 (#186) * started * first attempt finished * cleanup * included mounas feedback * Updating README with proper dpkg (#190) * [Installation] Fixing more installation errors (#191) * Fixing more errors * This will be much clearer * changed new_nmi to nmi * missed one :p * [SQL] Fixing MySQL 5.7 group by during visit creation (#192) * Fixing MySQL 5.7 group by during visit creation * Missed comma * Removing newVisitNo in group by * Added option to also re-insert deleted minc files (Same as PR#179) (#193) * added option to also re-insert * Remove profile changes * removing IBIS specific fields * No need to show another example of sql query * adding documentation and making sql more generic * more updates * fix path to run from mri directory * Option to re-insert deleted minc files: Based off of PR 179 * remove the original file * better readme * Cecile comments * relative to example scripts directory * Modified the deletemincsqlwrapper.pl so that when no files are found with the query, it prints it out so that the user do not feel like nothing happened. * revert to t1 from adniT1 * remove the wrong file * minor thing * chmod, run tarchiveLoader without seriesUID as an argument, and small messages change * [Install] Readme Version update, installer CentOS improvements (#188) * committing Readme version and installer changes * adding Readme changes * setting VERSION file to 18.0.0 * additional Readme updates * formatting in Readme * re-integrating updates * removing period * New installs now also have their Imaging Pipeline ConfigSettings populated based on the user answers during the installation process: Redmine 13199 * minor echo message change * rebasing removed Christine changes so add them again * update the dicom archive repo link (#199) Update submodule link for dicom_archive. * Do not store PatientName header in notification_spool table:Redmine 13506 * update README * Check consistent upload_id and filename when running the pipeline: Redmine 13507 (#202) * Check consistent upload_id and filename when running the pipeline: Redmine 13507 * make copy and paste a bit more intelligent * Mapping empty date of birth and scan to undef when empty so that it can be inserted in MySQL 5.7 (#205) * Creected code that tests if two float numbers are equal (#206) * [Cleanup]: Remove duplicate DBI.pm; Redmine 13613 (#207)
…d resolve conflicts (#280) * Initial import of files from http://code.google.com/p/dicom-archive/ * add two configurable options is_site and is_sge * Added new getIncomingDir config function * Added missing semi-colons. * Modifies the temporairy values of $data_dir, $get_dicom_info and $mail_user variables * Places back the forward slash in the email-address * Modifies the temporairy value for the tarchive_librairy location * Modified the tarchivelibdir temp value * Set the if_sge to false by default * Fixed the dcmodify --insert-tag option to --insert (option used in more recent dcmodify). * Updates the mri_upload table * Includes option to update the mri_upload table * Modification to the profileTemplate to be able to use DTIPrep pipeline * Added get_DTI_Site_CandID_Visit function in profile file * Cosmetic changes * Cosmetic changes * Fixed typos and indentation * Correct spelling mistakes * 1) added the functionality to insert the extension , 2) fixed indentation * Removed the filetype option * Changed the queries to use the prepared statements * Modified $d to $dir in profileTemplate * Remove .DS_Store file from DICOM source directory before creating new object. Other fails while reading content of dcm source directory * Modified getSubjectIDs so that it uses PatientName instead of PatientID lookupCenterID using patient name instead of PatientID * modified: profileTemplate * Moved reference to ~/.neurodb to .loris_mri directory * Some more files * Replaced .neurodb by .loris_mri in updateHeaders.pl * Removed the full path * DicomTar.pl should use proper $profile name instead of prod * Sometime DICOM Header may not have Invertion Time field (0018,9079). Set Inversion Time to 0 in tarchive_series to avoid error message: DBD::mysql::st execute failed: Data truncated for column 'InversionTime' * DICOM HEADER may not have Inversion time (0018,9079) set which cause tarchives_series sql table who expect a double to receive an empty string. * THIS IS A DUPLICATE from opionnalProfileFixInDicomTar pull request please ignore change in dicomTar.pl THIS IS A DUPLICATE from opionnalProfileFixInDicomTar pull request please ignore change in dicomTar.pl * removed useless numbers * Added $subjectID{'createVisitLabel'} option to profile template. * Changed $subjectID{'createVisitLabel'} type to boolean * added exit 0 at the end of the file * cosmetic change * Added a new option config $bin_dir * Fixed the option * Defined(@array) is deprecated. Removed error message on the console defined(@array) is deprecated at... (Maybe you should just omit the defined()?) * Removed all occurences of defined(@array). * replaced the sourcelocation column by DecompressedLocation * Added functionality to insert PET DICOMs in tarchive tables. * Fixed indentation in the pull request. * NIfTI support of the imaging pipeline (profileTemplate change). * Added -centerName option in call to dicomTar.pl. * Made ArchiveLocation relative in tarchive table. * Created a MySQL scripted patch to make ArchiveLocation in the tarchive table relative. * Added functionality to print query on one line. * Cleaned up and prepared statement for queries in main directory of dicom-archive-tools * Prepared mysql statement for DCMSUM.pm * Fixed bug inserted while integrating mysql prepare statements * Removed the Deprecated definition of array: !@Settings instead of !defined @Settings, to be in line with pull request #95 * One more consistency check on verbose and notification spool tables * One more explicit Done message * Fixes the insert in DCMSUM.pm so it does not set the creatinguser field in the tarchive table to NULL when the pipeline is run in auto-launch mode. * site or rather, study, no longer hard coded * removed extra ~ and the comments as per Cecile feedback * adding TarchiveSeriesID to the tarchive_files * Added the getSNRModalities function * added flair * typo * typo AGAIN * added comment based on SeriesUID and EchoTime * Removed getIncomingDir routine from profileTemplate; it is no longer used. Same as PR35 * Revert "adding TarchiveSeriesID to the tarchive_files" * isFileToBeRegisteredGivenProtocol in Profile now returns 1 if ne unknown * Incorporate comment of Dave * I cna not type wihtout making typos * re-adding TarchiveSeriesID to the tarchive_files * swap inserts * added comment * updated the comment with tarchive_files * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 (#182) * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 * went through all the files that get the settings from the prod file * added the install scripts * removed prefix from the Get_DTI_Site function * added data_dir as projects like IBIS could have it different from mincPath * Greg feedback on DB::DBI, removal of defined, and a masked variable declaration * added the script for existing projects to populate their default database values with those from their prod file * function return value * IBIS has all sorts of differences, the updates in this commit account for those * data_dir renamed to dataDirBasepath * Cecile feedback and applying her comments to all other files * fixed the message where the values is kept at its default, and removed debug print * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 (#45) * Loris-MRI configurations moved to the front end from the $profile file: Redmine 8893 * went through all the files that get the settings from the prod file * removed prefix from the Get_DTI_Site function * consistency in DB versus NeuroDB * one dollar sign instead of 2; but have no clue why * Cecile required changes * [ImagingUpload.pm] Look inside file type and not file path for the word dicom (#178) * Look inside file type and not file path for the word dicom * check for the whole dicom type string * spaces * spaces * Fix file count in mri_upload when deleting a minc file and then re-inserting (#180) * fixed minc deletion (#185) * Remove all .DS_Store files anywhere in the tree, and __MACOSX directory (#46) * Remove all .DS_Store files anywhere in the tree * The command will not complain even if it does not find a file to delete. * Incorporate the additional changes from Mouna * Removed files starting with . and __MACOSX directory from the uploaded scans: Redmine 11670 (#186) * started * first attempt finished * cleanup * included mounas feedback * Updating README with proper dpkg (#190) * [Installation] Fixing more installation errors (#191) * Fixing more errors * This will be much clearer * changed new_nmi to nmi * missed one :p * [SQL] Fixing MySQL 5.7 group by during visit creation (#192) * Fixing MySQL 5.7 group by during visit creation * Missed comma * Removing newVisitNo in group by * Added option to also re-insert deleted minc files (Same as PR#179) (#193) * added option to also re-insert * Remove profile changes * removing IBIS specific fields * No need to show another example of sql query * adding documentation and making sql more generic * more updates * fix path to run from mri directory * Option to re-insert deleted minc files: Based off of PR 179 * remove the original file * better readme * Cecile comments * relative to example scripts directory * Modified the deletemincsqlwrapper.pl so that when no files are found with the query, it prints it out so that the user do not feel like nothing happened. * revert to t1 from adniT1 * remove the wrong file * minor thing * chmod, run tarchiveLoader without seriesUID as an argument, and small messages change * [Install] Readme Version update, installer CentOS improvements (#188) * committing Readme version and installer changes * adding Readme changes * setting VERSION file to 18.0.0 * additional Readme updates * formatting in Readme * re-integrating updates * removing period * New installs now also have their Imaging Pipeline ConfigSettings populated based on the user answers during the installation process: Redmine 13199 * minor echo message change * rebasing removed Christine changes so add them again * update the dicom archive repo link (#199) Update submodule link for dicom_archive. * Do not store PatientName header in notification_spool table:Redmine 13506 * update README * Check consistent upload_id and filename when running the pipeline: Redmine 13507 (#202) * Check consistent upload_id and filename when running the pipeline: Redmine 13507 * make copy and paste a bit more intelligent * Mapping empty date of birth and scan to undef when empty so that it can be inserted in MySQL 5.7 (#205) * Creected code that tests if two float numbers are equal (#206) * [Cleanup]: Remove duplicate DBI.pm; Redmine 13613 (#207) * Add TarchiveID to mri_protocol_violated_scans (#211) * Adding TarchiveID information in mri_protocol_violated_scans table * Cleaned up commented parts * Renamed $tarchiveInfo to $tarchiveInfoRef for consistencies * Get file list after removal of undesired directories like __MACOSX: Redmine 13508 (#203) * Get file list after removal of undesired directories like __MACOSX: Redmine 13508 * change xargs to deleting from the find command * Dave and Nick feedback * Nicolas feedback; escaping the directory name * Refactor smart matching code in DTI.pm (#215) * Better MINC toolkit sourcing command in README and updated VERSION file (#260) * Better MINC toolkit sourcing command and updated VERSION file * cecile feedback * Updating QC tables if the -deleteQCdata flag is not set. Will update FileID to NULL in files_qcstatus and feedback_mri_comments (#261) * README has also within it LORIS-MRI version number, so update (#268) * Installer: Populate the default LORIS config settings for the MRI paths (Redmine 13915) (#272) * Populate Loris-MRI code path for new installs since the user is asked to enter the MRI project name * Populate other MRI data path with a better option than the default LORIS %PROJECTNAME * post installation checks * Add the condition Dave brought up during the imaging meeting; i.e. only change it for those that did not do it in the front end already * Ceciles feedback * oopsie * resolve some unresolved conflicts and remove all added empty lines * Ceciles feedback to remove duplicate getconfigsetting * feedback after discussing with Nick
Previous file_type content:
/tmp/ImagingUpload-12-48-Rv9qJY/LEGO_PHANTOM_HOS_20160830/DICOM/.test: ASCII text
New file_type content:
DICOM medical imaging data