Skip to content

Commit

Permalink
Merge pull request #9 from UCSB-VRL/chad/nph_with_mask_editing
Browse files Browse the repository at this point in the history
Updated NPH Preduction Module for Mask Editing Feature
  • Loading branch information
chandrakanth-gudavalli authored Apr 25, 2023
2 parents aa19cf0 + 0afbb62 commit 5d8a720
Show file tree
Hide file tree
Showing 10 changed files with 508 additions and 200 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ QRBSA/src/DREAM3D-6.5.141-Linux-x86_64/*
SpeciesTrackerAndCounter/src/runs/train/*
*.hdf5

*.tar
9 changes: 7 additions & 2 deletions nphprediction/PythonScriptWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def preprocess(self, bq, **kw):
"""
Pre-process the images
"""
log.info('CKPT01')
log.info('Pre-Process Options: %s' % (self.options))
"""
1. Get the resource image
Expand All @@ -53,7 +54,11 @@ def preprocess(self, bq, **kw):
predictor_url = bq.service_url('image_service', path=predictor_uniq)
log.info("predictor_URL: %s" % (predictor_url))
predictor_path = os.path.join(kw.get('stagingPath', 'source/Scans'), self.getstrtime()+'-'+image.name + '.nii')


os.mkdir('source/Scans')
log.info('CKPT03 ' + str(os.listdir('.')))
log.info('CKPT04 ' + str(os.listdir('source')))
log.info('CKPT02 ' + str(predictor_path))
predictor_path = bq.fetchblob(predictor_url, path=predictor_path)
log.info("predictor_path: %s" % (predictor_path))
#predictor_path = fetchImage(bq, predictor_url, dest=predictor_path, uselocalpath=True)
Expand Down Expand Up @@ -171,7 +176,7 @@ def run(self):
print(os.listdir(results_outdir))
self.outfiles = []
for files in os.listdir(results_outdir):
if files.endswith("1.nii.gz"):
if files.endswith('ome.tiff'):
self.outfiles.append(results_outdir+files)
bq.update_mex('Uploading Mask result')
self.resimage = self.uploadimgservice(bq, self.outfiles)
Expand Down
31 changes: 31 additions & 0 deletions nphprediction/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<h2>
<title>Volumetric Segmentation of Brain CT Scans</title>
</h2>

<body>

<h3>About:</h3>
<a href="public/workflow.png" target="_blank"> <img src="public/workflow.png" /></a>
<p>
This module is for segmenting a CT scan of a brain into 3 parts: lateral ventricles, cerebral matter, and subarachnoid space using a 3D UNet. A Support Vector Machine is then used to determine if the subject has possible Normal Pressure Hydrocephalus (NPH).
</p>

<p>
<a href="https://arxiv.org/abs/1901.09088" target="_blank">Paper: Automated Segmentation of CT Scans for Normal Pressure Hydrocephalus</a>.
</p>

<h3>Input</h3>
<p> The input should be a single image or a folder of images in nifti format (ending in .nii.gz).</p>
<h3>Outputs</h3>
<ul>
<li><b>Info:</b> CSV file of volumetric measurements and NPH prediction.</li>
<li><b>Segmentation Mask:</b>A segmentation mask in nifti format. If folder of images is used, a folder of segmentation masks are returned.</li>
</ul>


</body>

</html>
Empty file modified nphprediction/nphprediction.xml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion nphprediction/runtime-module.cfg
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module_enabled = True
runtime.platforms=command

[command]
docker.image = nph-v1
docker.image = nph-v3-mask-editor:v0.0.1
environments = Staged,Docker
executable = python PythonScriptWrapper.py
files = pydist, PythonScriptWrapper.py
Expand Down
Loading

0 comments on commit 5d8a720

Please sign in to comment.