-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from Emory-HITI/dev
Create the MRI SUVPaR module
- Loading branch information
Showing
6 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"InputFile": "sample.csv", | ||
"OutputFile": "output.csv", | ||
"FeaturesetFile": "featureset.txt" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |