Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import errors #47

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions SlicerDiffusionQC/GradQC.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import vtk, qt, ctk, slicer, mrml
from slicer.ScriptedLoadableModule import *

from gradqclib.slicerUserInteraction import slicerGUI
from diffusionqclib.nhdr_write import nhdr_write

#
# GradQC
#
Expand Down Expand Up @@ -286,7 +283,8 @@ def onSelectMask(self):


def onSelectInput(self):

from diffusionqclib.nhdr_write import nhdr_write

inPrefix= os.path.splitext(os.path.splitext(self.inputSelector.currentPath)[0])[0]
file_name= self.inputSelector.currentPath
if '.nii' in self.inputSelector.currentPath:
Expand Down Expand Up @@ -390,6 +388,8 @@ def observeStatus(caller,_):

def GUI(self):

from gradqclib.slicerUserInteraction import slicerGUI

# If in autoMode, don't call the Slicer GUI below, negative logic used for self.autoMode
if self.autoMode: # self.autoMode = True when check box checked

Expand Down
2 changes: 1 addition & 1 deletion diffusionqclib/diffusionqclib/dwi_attributes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Return headers, mri data, axis index along which gradients are listed, axialViewAxis, b-value, gradient directions
import nrrd
import numpy as np
from nhdr_write import nhdr_write
from .nhdr_write import nhdr_write
import os

def dwi_attributes(file_name, inPrefix):
Expand Down
4 changes: 2 additions & 2 deletions diffusionqclib/diffusionqclib/gradient_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
warnings.filterwarnings("ignore", category=FutureWarning)
import nibabel as nib

from dwi_attributes import dwi_attributes
from saveResults import saveResults
from .dwi_attributes import dwi_attributes
from .saveResults import saveResults

POINTS = 50 # For KDE estimation
eps = 2.2204e-16 # For preventing log( ) to be -inf
Expand Down
2 changes: 1 addition & 1 deletion diffusionqclib/diffusionqclib/nhdr_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# np.set_printoptions(precision= PRECISION, suppress= True, floatmode= 'maxprec')
np.set_printoptions(precision= PRECISION, suppress= True)

from bval_bvec_io import read_bvecs, read_bvals, bvec_scaling
from .bval_bvec_io import read_bvecs, read_bvals, bvec_scaling

def matrix_string(A):
# A= np.array(A)
Expand Down
8 changes: 4 additions & 4 deletions diffusionqclib/diffusionqclib/saveResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
warnings.filterwarnings("ignore", category=FutureWarning)
import nibabel as nib

from bval_bvec_io import read_bvals, read_bvecs, write_bvals, write_bvecs
from nhdr_write import nhdr_write
from .bval_bvec_io import read_bvals, read_bvecs, write_bvals, write_bvecs
from .nhdr_write import nhdr_write

def saveDecisions(outPrefix, deletion, confidence, bvals):

fqc = open(outPrefix+'_QC.csv', "w")
fcon = open(outPrefix+'_confidence.csv', "w")
fqc.write('Gradient #, Pass 1\Fail 0, b value\n')
fcon.write('Gradient #, Sure 1\Unsure 0, b value\n')
fqc.write('Gradient #, Pass 1/Fail 0, b value\n')
fcon.write('Gradient #, Sure 1/Unsure 0, b value\n')
for i in range(len(deletion)):
fqc.write(str(i) + ',' + str(deletion[i]) + ','+ str(bvals[i])+'\n')
fcon.write(str(i) + ',' + str(confidence[i]) + ','+ str(bvals[i])+'\n')
Expand Down