{"action":"created","comment":{"url":"https://api.github.com/repos/aces/Loris-MRI/pulls/comments/71714915","id":71714915,"diff_hunk":"@@ -0,0 +1,142 @@\n+#! /usr/bin/perl\n+use strict;\n+use warnings;\n+use Carp;\n+use Getopt::Tabular;\n+use FileHandle;\n+use File::Basename;\n+use File::Temp qw/ tempdir /;\n+use File::Path qw/ make_path /;\n+use Data::Dumper;\n+use FindBin;\n+use Cwd qw/ abs_path /;\n+\n+# These are the NeuroDB modules to be used\n+use lib \"$FindBin::Bin\";\n+use NeuroDB::File;\n+use NeuroDB::MRI;\n+use NeuroDB::DBI;\n+use NeuroDB::Notify;\n+use NeuroDB::MRIProcessingUtility;\n+\n+my $profile   = '';      # this should never be set unless you are in a\n+                             # stable production environment\n+my $seriesuid = '';\n+my $query     = '';\n+my $selORdel  = '';\n+my @opt_table = (\n+                 [\"Basic options\",\"section\"],\n+                 [\"-profile     \",\"string\",1, \\$profile,\n+                  \"name of config file in ../dicom-archive/.loris_mri\"\n+                 ],\n+                 [\"-seriesuid\", \"string\", 1, \\$seriesuid, \"Only deletes this SeriesUID\"\n+                 ],\n+                 );\n+\n+&Getopt::Tabular::GetOptions(\\@opt_table, \\@ARGV) || exit 1;\n+\n+################################################################\n+################### input option error checking ################\n+################################################################\n+{ package Settings; do \"$ENV{LORIS_CONFIG}/.loris_mri/$profile\" }\n+if ($profile && !@Settings::db) { \n+    print \"\\n\\tERROR: You don't have a configuration file named \". \n+          \"'$profile' in:  $ENV{LORIS_CONFIG}/.loris_mri/ \\n\\n\"; \n+    exit 2; \n+}\n+if (!$ARGV[0] || !$profile) { \n+    print \" ERROR: You must type select or confirm and have an \".\n+          \"existing profile.\\n\\n\";\n+    exit 3;  \n+}\n+\n+if ($ARGV[0] eq \"confirm\") {\n+  $selORdel  = \"DELETE \";\n+} else {\n+  $selORdel  = \"SELECT * \";\n+}\n+\n+my $data_dir         = $Settings::data_dir;\n+my $dbh = &NeuroDB::DBI::connect_to_db(@Settings::db);\n+\n+\n+sub selORdel {\n+  my ($table, $field) = @_;\n+  my $where = '';\n+\n+  if ($table eq \"parameter_file\") {\n+    $where = \" WHERE FileID = (SELECT FileID FROM files WHERE SeriesUID = ?)\";\n+  } else {\n+    $where = \" WHERE SeriesUID = ?\";\n+  }\n+\n+  my $query = $selORdel . \"FROM \" . $table . $where;\n+  print $query . \"\\n\";\n+  my $sth = $dbh->prepare($query);\n+  $sth->execute($seriesuid);\n+\n+  if ($selORdel eq \"SELECT * \") {\n+    while (my $pf = $sth->fetchrow_hashref()) {\n+        print \"\\n$field: \" . $pf->{$field};\n+    }\n+  }\n+}\n+\n+\n+# Delete from FS:\n+# /data/ibis/data_assembly/858677/V24/mri/native/ibis_858677_V24_dti_005.mnc\n+# /data/ibis/data/pic/858677/ibis_858677_V24_dti_005_43606_check.jpg\n+# /data/ibis/data/jiv\n+","path":"uploadNeuroDB/minc_deletion.pl","position":90,"original_position":90,"commit_id":"8ef81a7b1c057a5ef0483a4164001aad58ec7309","original_commit_id":"8ef81a7b1c057a5ef0483a4164001aad58ec7309","user":{"login":"MounaSafiHarab","id":15198379,"avatar_url":"https://avatars.githubusercontent.com/u/15198379?v=3","gravatar_id":"","url":"https://api.github.com/users/MounaSafiHarab","html_url":"https://github.com/MounaSafiHarab","followers_url":"https://api.github.com/users/MounaSafiHarab/followers","following_url":"https://api.github.com/users/MounaSafiHarab/following{/other_user}","gists_url":"https://api.github.com/users/MounaSafiHarab/gists{/gist_id}","starred_url":"https://api.github.com/users/MounaSafiHarab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MounaSafiHarab/subscriptions","organizations_url":"https://api.github.com/users/MounaSafiHarab/orgs","repos_url":"https://api.github.com/users/MounaSafiHarab/repos","events_url":"https://api.github.com/users/MounaSafiHarab/events{/privacy}","received_events_url":"https://api.github.com/users/MounaSafiHarab/received_events","type":"User","site_admin":false},"body":"@gluneau \r\ncan we delete this comment?","created_at":"2016-07-21T14:25:35Z","updated_at":"2016-07-21T14:25:35Z","html_url":"https://github.com/aces/Loris-MRI/pull/138#discussion_r71714915","pull_request_url":"https://api.github.com/repos/aces/Loris-MRI/pulls/138","_links":{"self":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/comments/71714915"},"html":{"href":"https://github.com/aces/Loris-MRI/pull/138#discussion_r71714915"},"pull_request":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/138"}}},"pull_request":{"url":"https://api.github.com/repos/aces/Loris-MRI/pulls/138","id":75700855,"html_url":"https://github.com/aces/Loris-MRI/pull/138","diff_url":"https://github.com/aces/Loris-MRI/pull/138.diff","patch_url":"https://github.com/aces/Loris-MRI/pull/138.patch","issue_url":"https://api.github.com/repos/aces/Loris-MRI/issues/138","number":138,"state":"open","locked":false,"title":"remove minc, add a minc based on SeriesUID","user":{"login":"gluneau","id":2903505,"avatar_url":"https://avatars.githubusercontent.com/u/2903505?v=3","gravatar_id":"","url":"https://api.github.com/users/gluneau","html_url":"https://github.com/gluneau","followers_url":"https://api.github.com/users/gluneau/followers","following_url":"https://api.github.com/users/gluneau/following{/other_user}","gists_url":"https://api.github.com/users/gluneau/gists{/gist_id}","starred_url":"https://api.github.com/users/gluneau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluneau/subscriptions","organizations_url":"https://api.github.com/users/gluneau/orgs","repos_url":"https://api.github.com/users/gluneau/repos","events_url":"https://api.github.com/users/gluneau/events{/privacy}","received_events_url":"https://api.github.com/users/gluneau/received_events","type":"User","site_admin":false},"body":"New script to delete minc file based on SeriesUID\r\n\r\n`uploadNeuroDB/minc_deletion.pl -profile prod -seriesuid 1.3.12.2.1107.5.2.32.35045.201507232316035928639007.0.0.0 confirm`\r\n\r\nModification of tarchiveLoader so that a unique file can be inserted based on SeriesUID\r\n\r\n`uploadNeuroDB/tarchiveLoader -globLocation -profile null_grads -seriesuid 1.3.12.2.1107.5.2.32.35045.201507232316035928639007.0.0.0 DCM_2015-07-23_ImagingUpload-10-38-WiBmLY.tar`\r\n\r\n","created_at":"2016-06-29T18:48:35Z","updated_at":"2016-07-21T14:25:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31adeefa27bea332021f7d5b7a0ba626d2858cca","assignee":{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"assignees":[{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/aces/Loris-MRI/milestones/4","html_url":"https://github.com/aces/Loris-MRI/milestones/16.1","labels_url":"https://api.github.com/repos/aces/Loris-MRI/milestones/4/labels","id":1777983,"number":4,"title":"16.1","description":"","creator":{"login":"christinerogers","id":827619,"avatar_url":"https://avatars.githubusercontent.com/u/827619?v=3","gravatar_id":"","url":"https://api.github.com/users/christinerogers","html_url":"https://github.com/christinerogers","followers_url":"https://api.github.com/users/christinerogers/followers","following_url":"https://api.github.com/users/christinerogers/following{/other_user}","gists_url":"https://api.github.com/users/christinerogers/gists{/gist_id}","starred_url":"https://api.github.com/users/christinerogers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christinerogers/subscriptions","organizations_url":"https://api.github.com/users/christinerogers/orgs","repos_url":"https://api.github.com/users/christinerogers/repos","events_url":"https://api.github.com/users/christinerogers/events{/privacy}","received_events_url":"https://api.github.com/users/christinerogers/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":2,"state":"open","created_at":"2016-05-20T03:23:26Z","updated_at":"2016-07-20T18:33:29Z","due_on":"2016-07-01T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/aces/Loris-MRI/pulls/138/commits","review_comments_url":"https://api.github.com/repos/aces/Loris-MRI/pulls/138/comments","review_comment_url":"https://api.github.com/repos/aces/Loris-MRI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aces/Loris-MRI/issues/138/comments","statuses_url":"https://api.github.com/repos/aces/Loris-MRI/statuses/8ef81a7b1c057a5ef0483a4164001aad58ec7309","head":{"label":"gluneau:nullgrads","ref":"nullgrads","sha":"8ef81a7b1c057a5ef0483a4164001aad58ec7309","user":{"login":"gluneau","id":2903505,"avatar_url":"https://avatars.githubusercontent.com/u/2903505?v=3","gravatar_id":"","url":"https://api.github.com/users/gluneau","html_url":"https://github.com/gluneau","followers_url":"https://api.github.com/users/gluneau/followers","following_url":"https://api.github.com/users/gluneau/following{/other_user}","gists_url":"https://api.github.com/users/gluneau/gists{/gist_id}","starred_url":"https://api.github.com/users/gluneau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluneau/subscriptions","organizations_url":"https://api.github.com/users/gluneau/orgs","repos_url":"https://api.github.com/users/gluneau/repos","events_url":"https://api.github.com/users/gluneau/events{/privacy}","received_events_url":"https://api.github.com/users/gluneau/received_events","type":"User","site_admin":false},"repo":{"id":62154802,"name":"Loris-MRI","full_name":"gluneau/Loris-MRI","owner":{"login":"gluneau","id":2903505,"avatar_url":"https://avatars.githubusercontent.com/u/2903505?v=3","gravatar_id":"","url":"https://api.github.com/users/gluneau","html_url":"https://github.com/gluneau","followers_url":"https://api.github.com/users/gluneau/followers","following_url":"https://api.github.com/users/gluneau/following{/other_user}","gists_url":"https://api.github.com/users/gluneau/gists{/gist_id}","starred_url":"https://api.github.com/users/gluneau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluneau/subscriptions","organizations_url":"https://api.github.com/users/gluneau/orgs","repos_url":"https://api.github.com/users/gluneau/repos","events_url":"https://api.github.com/users/gluneau/events{/privacy}","received_events_url":"https://api.github.com/users/gluneau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gluneau/Loris-MRI","description":"The set of scripts that preprocess and insert MRI data into the database.","fork":true,"url":"https://api.github.com/repos/gluneau/Loris-MRI","forks_url":"https://api.github.com/repos/gluneau/Loris-MRI/forks","keys_url":"https://api.github.com/repos/gluneau/Loris-MRI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gluneau/Loris-MRI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gluneau/Loris-MRI/teams","hooks_url":"https://api.github.com/repos/gluneau/Loris-MRI/hooks","issue_events_url":"https://api.github.com/repos/gluneau/Loris-MRI/issues/events{/number}","events_url":"https://api.github.com/repos/gluneau/Loris-MRI/events","assignees_url":"https://api.github.com/repos/gluneau/Loris-MRI/assignees{/user}","branches_url":"https://api.github.com/repos/gluneau/Loris-MRI/branches{/branch}","tags_url":"https://api.github.com/repos/gluneau/Loris-MRI/tags","blobs_url":"https://api.github.com/repos/gluneau/Loris-MRI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gluneau/Loris-MRI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gluneau/Loris-MRI/git/refs{/sha}","trees_url":"https://api.github.com/repos/gluneau/Loris-MRI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gluneau/Loris-MRI/statuses/{sha}","languages_url":"https://api.github.com/repos/gluneau/Loris-MRI/languages","stargazers_url":"https://api.github.com/repos/gluneau/Loris-MRI/stargazers","contributors_url":"https://api.github.com/repos/gluneau/Loris-MRI/contributors","subscribers_url":"https://api.github.com/repos/gluneau/Loris-MRI/subscribers","subscription_url":"https://api.github.com/repos/gluneau/Loris-MRI/subscription","commits_url":"https://api.github.com/repos/gluneau/Loris-MRI/commits{/sha}","git_commits_url":"https://api.github.com/repos/gluneau/Loris-MRI/git/commits{/sha}","comments_url":"https://api.github.com/repos/gluneau/Loris-MRI/comments{/number}","issue_comment_url":"https://api.github.com/repos/gluneau/Loris-MRI/issues/comments{/number}","contents_url":"https://api.github.com/repos/gluneau/Loris-MRI/contents/{+path}","compare_url":"https://api.github.com/repos/gluneau/Loris-MRI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gluneau/Loris-MRI/merges","archive_url":"https://api.github.com/repos/gluneau/Loris-MRI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gluneau/Loris-MRI/downloads","issues_url":"https://api.github.com/repos/gluneau/Loris-MRI/issues{/number}","pulls_url":"https://api.github.com/repos/gluneau/Loris-MRI/pulls{/number}","milestones_url":"https://api.github.com/repos/gluneau/Loris-MRI/milestones{/number}","notifications_url":"https://api.github.com/repos/gluneau/Loris-MRI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gluneau/Loris-MRI/labels{/name}","releases_url":"https://api.github.com/repos/gluneau/Loris-MRI/releases{/id}","deployments_url":"https://api.github.com/repos/gluneau/Loris-MRI/deployments","created_at":"2016-06-28T15:56:34Z","updated_at":"2016-06-28T15:56:36Z","pushed_at":"2016-07-20T20:05:45Z","git_url":"git://github.com/gluneau/Loris-MRI.git","ssh_url":"git@github.com:gluneau/Loris-MRI.git","clone_url":"https://github.com/gluneau/Loris-MRI.git","svn_url":"https://github.com/gluneau/Loris-MRI","homepage":"","size":921,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"16.1-dev"}},"base":{"label":"aces:16.1-dev","ref":"16.1-dev","sha":"c0a8b7b11c1929bcacc267ae655399cc49354644","user":{"login":"aces","id":472868,"avatar_url":"https://avatars.githubusercontent.com/u/472868?v=3","gravatar_id":"","url":"https://api.github.com/users/aces","html_url":"https://github.com/aces","followers_url":"https://api.github.com/users/aces/followers","following_url":"https://api.github.com/users/aces/following{/other_user}","gists_url":"https://api.github.com/users/aces/gists{/gist_id}","starred_url":"https://api.github.com/users/aces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aces/subscriptions","organizations_url":"https://api.github.com/users/aces/orgs","repos_url":"https://api.github.com/users/aces/repos","events_url":"https://api.github.com/users/aces/events{/privacy}","received_events_url":"https://api.github.com/users/aces/received_events","type":"Organization","site_admin":false},"repo":{"id":2728966,"name":"Loris-MRI","full_name":"aces/Loris-MRI","owner":{"login":"aces","id":472868,"avatar_url":"https://avatars.githubusercontent.com/u/472868?v=3","gravatar_id":"","url":"https://api.github.com/users/aces","html_url":"https://github.com/aces","followers_url":"https://api.github.com/users/aces/followers","following_url":"https://api.github.com/users/aces/following{/other_user}","gists_url":"https://api.github.com/users/aces/gists{/gist_id}","starred_url":"https://api.github.com/users/aces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aces/subscriptions","organizations_url":"https://api.github.com/users/aces/orgs","repos_url":"https://api.github.com/users/aces/repos","events_url":"https://api.github.com/users/aces/events{/privacy}","received_events_url":"https://api.github.com/users/aces/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aces/Loris-MRI","description":"The set of scripts that preprocess and insert MRI data into the database.","fork":false,"url":"https://api.github.com/repos/aces/Loris-MRI","forks_url":"https://api.github.com/repos/aces/Loris-MRI/forks","keys_url":"https://api.github.com/repos/aces/Loris-MRI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aces/Loris-MRI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aces/Loris-MRI/teams","hooks_url":"https://api.github.com/repos/aces/Loris-MRI/hooks","issue_events_url":"https://api.github.com/repos/aces/Loris-MRI/issues/events{/number}","events_url":"https://api.github.com/repos/aces/Loris-MRI/events","assignees_url":"https://api.github.com/repos/aces/Loris-MRI/assignees{/user}","branches_url":"https://api.github.com/repos/aces/Loris-MRI/branches{/branch}","tags_url":"https://api.github.com/repos/aces/Loris-MRI/tags","blobs_url":"https://api.github.com/repos/aces/Loris-MRI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aces/Loris-MRI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aces/Loris-MRI/git/refs{/sha}","trees_url":"https://api.github.com/repos/aces/Loris-MRI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aces/Loris-MRI/statuses/{sha}","languages_url":"https://api.github.com/repos/aces/Loris-MRI/languages","stargazers_url":"https://api.github.com/repos/aces/Loris-MRI/stargazers","contributors_url":"https://api.github.com/repos/aces/Loris-MRI/contributors","subscribers_url":"https://api.github.com/repos/aces/Loris-MRI/subscribers","subscription_url":"https://api.github.com/repos/aces/Loris-MRI/subscription","commits_url":"https://api.github.com/repos/aces/Loris-MRI/commits{/sha}","git_commits_url":"https://api.github.com/repos/aces/Loris-MRI/git/commits{/sha}","comments_url":"https://api.github.com/repos/aces/Loris-MRI/comments{/number}","issue_comment_url":"https://api.github.com/repos/aces/Loris-MRI/issues/comments{/number}","contents_url":"https://api.github.com/repos/aces/Loris-MRI/contents/{+path}","compare_url":"https://api.github.com/repos/aces/Loris-MRI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aces/Loris-MRI/merges","archive_url":"https://api.github.com/repos/aces/Loris-MRI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aces/Loris-MRI/downloads","issues_url":"https://api.github.com/repos/aces/Loris-MRI/issues{/number}","pulls_url":"https://api.github.com/repos/aces/Loris-MRI/pulls{/number}","milestones_url":"https://api.github.com/repos/aces/Loris-MRI/milestones{/number}","notifications_url":"https://api.github.com/repos/aces/Loris-MRI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aces/Loris-MRI/labels{/name}","releases_url":"https://api.github.com/repos/aces/Loris-MRI/releases{/id}","deployments_url":"https://api.github.com/repos/aces/Loris-MRI/deployments","created_at":"2011-11-07T20:19:37Z","updated_at":"2015-05-23T18:37:52Z","pushed_at":"2016-07-20T20:05:46Z","git_url":"git://github.com/aces/Loris-MRI.git","ssh_url":"git@github.com:aces/Loris-MRI.git","clone_url":"https://github.com/aces/Loris-MRI.git","svn_url":"https://github.com/aces/Loris-MRI","homepage":"","size":1064,"stargazers_count":4,"watchers_count":4,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":11,"forks":20,"open_issues":11,"watchers":4,"default_branch":"16.1-dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/138"},"html":{"href":"https://github.com/aces/Loris-MRI/pull/138"},"issue":{"href":"https://api.github.com/repos/aces/Loris-MRI/issues/138"},"comments":{"href":"https://api.github.com/repos/aces/Loris-MRI/issues/138/comments"},"review_comments":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/138/comments"},"review_comment":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aces/Loris-MRI/pulls/138/commits"},"statuses":{"href":"https://api.github.com/repos/aces/Loris-MRI/statuses/8ef81a7b1c057a5ef0483a4164001aad58ec7309"}}}}
{"actor":{"display_login":"MounaSafiHarab"}}