def test_pkg_info(): """Smoke test nibabel.get_info() Hits: - nibabel.get_info - nibabel.pkg_info.get_pkg_info - nibabel.pkg_info.pkg_commit_hash """ info = nib.get_info()
def test_pkg_info(): """Simple smoke test Hits: - nibabel.get_info - nibabel.pkg_info.get_pkg_info - nibabel.pkg_info.pkg_commit_hash """ info = nib.get_info()
#=============================================================================== sTime = time.time() waveName = 'coif1'; waveLevel = 5 InputFileName = os.path.basename(niftiFileDir) (InputFileDir, InputFileName) = os.path.split(niftiFileDir) InputfileBaseName = fStripExtension( InputFileName ) #print InputFileName, InputfileBaseName, InputFileDir nimBabel = nib.load(niftiFileDir) nimBabelData = nimBabel.get_data() nimBabelInfo = nib.get_info() nimBabelAffine = nimBabel.get_affine() nimBabelHeader = nimBabel.get_header().structarr nimBabelPixDim = nimBabelHeader['pixdim'] numpyBabelDataSz = numpy.asarray(nimBabelData.shape) if len(numpyBabelDataSz) <= 3: print 'ERROR: Wrong dim size input...' exit -1 #VoxelSD = scipy.std( nimBabelData, axis=3 ) #frameRMS = list() #frameRMS_MM = list() #frameSD = list() nStats = 6
fileID.write('%.8f' % inputData[2, i] + "\n") #=============================================================================== sTime = time.time() InputFileName = os.path.basename(niftiFileDir) (InputFileDir, InputFileName) = os.path.split(niftiFileDir) InputfileBaseName = fStripExtension(InputFileName) #print InputFileName, InputfileBaseName, InputFileDir nimBabel = nib.load(niftiFileDir) nimBabelData = nimBabel.get_data() nimBabelInfo = nib.get_info() nimBabelAffine = nimBabel.get_affine() nimBabelHeader = nimBabel.get_header().structarr nimBabelPixDim = nimBabelHeader['pixdim'] numpyBabelDataSz = numpy.asarray(nimBabelData.shape) if len(numpyBabelDataSz) <= 3: print 'ERROR: Wrong dim size input...' exit - 1 # Temporal SNR in brain mask # Simple SNR (mean/SNR) # of frames greater than .5 from motion outliers in FLS # of frames with DVARs above 0.5 # of frames with DVARs above 0.7 # of frames with rms/mm frame above .2
# read the nifti file... #=============================================================================== if (niftiDir[-1] != os.sep): niftiDir = niftiDir + os.sep if (outputDir[-1] != os.sep): outputDir = outputDir + os.sep InputFileBase = dwiFile.split('.')[0] dwiDirFile = os.path.normpath(niftiDir +os.sep+ dwiFile) print "Nifti File: " + dwiDirFile nibDWI = nib.load(dwiDirFile) nibDWIData = nibDWI.get_data() nibDWIInfo = nib.get_info() nibDWIAffine = nibDWI.get_affine() nibDWIHeader = nibDWI.get_header().structarr nibDWIPixDim = nibDWIHeader['pixdim'] nibDWIDataSz = numpy.asarray(nibDWIData.shape) print nibDWIDataSz #=============================================================================== # read the bval file... #=============================================================================== if bvalsFile: bvalsFile = os.path.normpath(niftiDir +os.sep+ bvalsFile) else: bvalsFile = os.path.normpath(niftiDir +os.sep+ InputFileBase + '.bval') print 'Bvals File: %s' % bvalsFile
# read the nifti file... #=============================================================================== if (niftiDir[-1] != os.sep): niftiDir = niftiDir + os.sep if (outputDir[-1] != os.sep): outputDir = outputDir + os.sep InputFileBase = dwiFile.split('.')[0] dwiDirFile = os.path.normpath(niftiDir + os.sep + dwiFile) print "Nifti File: " + dwiDirFile nibDWI = nib.load(dwiDirFile) nibDWIData = nibDWI.get_data() nibDWIInfo = nib.get_info() nibDWIAffine = nibDWI.get_affine() nibDWIHeader = nibDWI.get_header().structarr nibDWIPixDim = nibDWIHeader['pixdim'] nibDWIDataSz = numpy.asarray(nibDWIData.shape) print nibDWIDataSz #=============================================================================== # read the bval file... #=============================================================================== if bvalsFile: bvalsFile = os.path.normpath(niftiDir + os.sep + bvalsFile) else: bvalsFile = os.path.normpath(niftiDir + os.sep + InputFileBase + '.bval') print 'Bvals File: %s' % bvalsFile