hsieh42 / exit_process

Exit process and project boards for tracking issues.
0 stars 0 forks source link

Batch pulling DICOM studies from Research PACS #32

Open hsieh42 opened 6 years ago

hsieh42 commented 6 years ago

We would need to talk about batch pulling from Reseach PACS next week. More information to follow.

Workflow:

  1. Identify the studies you need.
  2. Get accession numbers with @pantalol's help.
  3. Use the lab workstation MJDWEDK which is the one behind Lauren to perform the query and pulling of studies. MJDWEDK is the only machine that is permitted to communicate to the research PACS server 170.166.22.19. You could either do it physically or remotely to mjdwedk.uphs.pennhealth.prv.
  4. The codes are written in Matlab and requires a Matlab instance to perform the query and pull by accession number. The steps are:

    1. Change the directory to the code base D:\Shonket Ray\Research-PACS-BatchPulling or add this to path.
    2. Depending on which AE title you are trying to get the studies from (RAWMAMMO or KONTOS_PROCESSED), comment and uncomment the cmd lines in findStudyInstanceUID.m and copyImagesForThisStudyInstanceUID.m. Most of the time you would do the pulling against KONTOS_PROCESSED so make sure the corresponding line is uncommented.

       %for Rawmammo
       %cmd = 'dos(''findscu -v -S -aet MJDWEDK -aec RAWMAMMO 170.166.22.19 105 test_acc.dcm -k 0020,000D -k 0020,1206'') ;' ;
      
       % for Kontos_processed
       cmd = 'dos(''findscu -v -S -aet MJDWEDK2 -aec KONTOS_PROCESSED 170.166.22.19 104 test_acc.dcm -k 0020,000D -k 0020,1206'') ;' ;
    3. Create an array to hold all the accession numbers you are about to query and pull.
       acc=[12345678; 23456789; 34567890];
    4. Check the availability and review how many can be found (acc_num) and what is missing (acc_num_rem).
      b=checkCaseAvailability(acc);
      acc_num=sum(b(:));
      rem_ind=find(b==0);
      acc_num_rem=acc(rem_ind);
    5. Download the studies to root directory.
      root='/path/to/save/the/data/';
      batchDownloadAccessionNumbers(acc, root);
  5. Now you get the DICOM studies pulled from the Research PACS to MJDWEDK. You should start the anonymization process.
hsieh42 commented 6 years ago

@njahani @bhaghighi @gastouna @pantalol @BardiaYou Guys, so this post is still a valid and only way to retrieve the DICOM studies from research PACS. We were not able to do so because apparently the IP address has been changed. See #40.