Skip to content

Commit

Permalink
Merge pull request #231 from Emory-HITI/dev
Browse files Browse the repository at this point in the history
Create the MRI SUVPaR module
  • Loading branch information
pradeeban authored Sep 23, 2021
2 parents dc7ff48 + 084db14 commit 0f6d0d1
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 9 deletions.
21 changes: 12 additions & 9 deletions modules/rta-extraction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ The RTA Extractor runs continuously to load the data (labs, meds and orders) in

# Configuring Niffler RTA Extractor

Niffler real-time extraction must be configured as a service for it to run continuously and resume automatically even when the server restarts. Unless you are the administrator who is configuring Niffler for the first time, skip this section.
Niffler RTA Extractor must be configured as a service for it to run continuously and resume automatically even when the server restarts. Unless you are the administrator who is configuring Niffler for the first time, skip this section.

Find the system.json file in the service folder and modify accordingly.

system.json entries are to be set *only once* for the Niffler deployment by the administrator. Once set, further extractions do not require a change.

* *DCM4CHEBin*: Set the correct location of the DCM4_CHE folder.

* *QueryAet*: Set the correct AET:PORT of the querying AET (i.e., this script). Typically same as the values you set for the storescp.

* *StorageFolder*: Create a folder where you like your DICOM files to be. Usually, this is an empty folder (since each extraction is unique).

* *FilePath*: By default, "{00100020}/{0020000D}/{0020000E}/{00080018}.dcm". This indicates a hierarchical storage of patients/studies/series/instances.dcm. Leave this value as it is unless you want to change the hierarchy.

* *LabsURL*: Set the URL providing continous labs data.
* *MedsURL*: Set the URL providing continous meds data.
* *OrdersURL*: Set the URL providing continous orders data.
* *LabsDataLoadFrequency*: Time Frequency for loading labs data onto MongoDB. The frequency is to be provided in minutes.
* *MedsDataLoadFrequency*: Time Frequency for loading meds data onto MongoDB. The frequency is to be provided in minutes.
* *OrdersDataLoadFrequency*: Time Frequency for loading orders data onto MongoDB. The frequency is to be provided in minutes.
* *UserName*: Set the Username Credentials for RTA Connection.
* *PassCode*: Set the Passcode Credentials for RTA Connection.
* *MongoURI*: Set the MongoDB Connection URL.
* *MongoUserName*: Set the MongoDB Username for Credentials.
* *MongoPassCode*: Set the MongoDB Passcode for Credentials.

## Configure DICOM attributes to extract

Expand Down
24 changes: 24 additions & 0 deletions modules/suvpar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SUVPaR: Scanner Usage Visualization with PACS and RIS data

This is a module that utilizes Niffler's other modules and [Eaglescope](https://github.com/sharmalab/eaglescope) to
visualize MRI Scanner Usage.


# Configuring Niffler SUVPaR

Find the config.json file in the folder and modify accordingly.

* *InputFile*: The metadata in a csv file, as produced by the cold-extraction -> png-extraction workflow.

* *OutputFile*: The output csv file with just the properties listed in the FeaturesetFile.

* *FeaturesetFile*: The subset of the properties that must be stored in the OutputFile.


# Running Niffler SUVPaR

First, to run the script to trim the file.

````
$ python3 Strip.py
````
25 changes: 25 additions & 0 deletions modules/suvpar/Strip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pandas
import logging
import json

logging.basicConfig(level=logging.INFO)


def initialize_config_and_execute():
with open('config.json', 'r') as f:
config = json.load(f)

feature_file = config['FeaturesetFile']
filename = config['InputFile']
output_csv = config['OutputFile']

text_file = open(feature_file, "r")
feature_list = text_file.read().split('\n')

filtered_csv = pandas.read_csv(filename, usecols=lambda x: x in feature_list, sep=',')
df = pandas.DataFrame(filtered_csv)
df.to_csv(output_csv)


if __name__ == "__main__":
initialize_config_and_execute()
6 changes: 6 additions & 0 deletions modules/suvpar/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"InputFile": "sample.csv",
"OutputFile": "output.csv",
"FeaturesetFile": "featureset.txt"

}
47 changes: 47 additions & 0 deletions modules/suvpar/featureset.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
AccessionNumber
InstitutionAddress
PatientSex
StudyDate
StudyTime
DeviceSerialNumber
PatientID
StudyDescription
ProtocolName
PerformedProcedureStepDescription
NumberOfStudyRelatedSeries
NumberOfStudyRelatedInstances
AcquisitionDate
AcquisitionTime
SeriesDate
SeriesTime
SeriesNumber
SeriesDescription
ImageType
SequenceName
MRAcquisitionType
ScanOptions
ReceiveCoilName
ImagesInAcquisition
InstanceNumber
AcquisitionDuration
ReconstructionDiameter
PercentPhaseFieldOfView
PixelSpacing
AcquisitionMatrix
InPlanePhaseEncodingDirection
SliceThickness
RepetitionTime
EchoTime
InversionTime
NumberOfAverages
EchoNumbers
SpacingBetweenSlices
NumberOfPhaseEncodingSteps
EchoTrainLength
PercentSampling
PixelBandwidth
FlipAngle
SAR
Modality
Manufacturer
ManufacturerModelName
4 changes: 4 additions & 0 deletions modules/suvpar/sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PatientID,PatientName,PatientSex
1,AAA,F
2,BBB,M
3,CCC,F

0 comments on commit 0f6d0d1

Please sign in to comment.