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

[FEAT EXTRACTION] - IndexError: Error filling GLSZM. #676

Closed
daivagyapareek opened this issue Jan 26, 2021 · 3 comments
Closed

[FEAT EXTRACTION] - IndexError: Error filling GLSZM. #676

daivagyapareek opened this issue Jan 26, 2021 · 3 comments
Labels

Comments

@daivagyapareek
Copy link

I am using 32 GB MBP and I am getting following error for one image, not sure what causing it.


IndexError Traceback (most recent call last)
in
5 print(len(comp_time),patient,(comp_time[-1]-comp_time[0])/60)
6 # try:
----> 7 result = extractor.execute(train_nrrd+patient+'/segmented.nrrd',train_nrrd+patient+'/filter.nrrd')
8 key_val = [(key,np.float64(val)) for key,val in result.items() if key in featureList]
9 key_val.append(('patientID',str(patient)))

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/featureextractor.py in execute(self, imageFilepath, maskFilepath, label, label_channel, voxelBased)
328 logger.info('Calculating features for %s image', imageTypeName)
329 inputImage, inputMask = imageoperations.cropToTumorMask(inputImage, mask, boundingBox, padDistance=kernelRadius)
--> 330 featureVector.update(self.computeFeatures(inputImage, inputMask, imageTypeName, **inputKwargs))
331
332 logger.debug('Features extracted')

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/featureextractor.py in computeFeatures(self, image, mask, imageTypeName, **kwargs)
515 featureClass.enableFeatureByName(feature)
516
--> 517 for (featureName, featureValue) in six.iteritems(featureClass.execute()):
518 newFeatureName = '%s_%s_%s' % (imageTypeName, featureClassName, featureName)
519 featureVector[newFeatureName] = featureValue

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/base.py in execute(self)
183 self._calculateVoxels()
184 else:
--> 185 self._calculateSegment()
186
187 return self.featureValues

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/base.py in _calculateSegment(self)
222 def _calculateSegment(self):
223 # Get the feature values using the current segment.
--> 224 for success, featureName, featureValue in self._calculateFeatures():
225 # Always store the result. In case of an error, featureValue will be NaN
226 self.featureValues[featureName] = numpy.squeeze(featureValue)

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/base.py in _calculateFeatures(self, voxelCoordinates)
229 # Initialize the calculation
230 # This function serves to calculate the texture matrices where applicable
--> 231 self._initCalculation(voxelCoordinates)
232
233 self.logger.debug('Calculating features')

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/glszm.py in _initCalculation(self, voxelCoordinates)
63
64 def _initCalculation(self, voxelCoordinates=None):
---> 65 self.P_glszm = self._calculateMatrix(voxelCoordinates)
66
67 self._calculateCoefficients()

~/opt/anaconda3/lib/python3.8/site-packages/radiomics/glszm.py in _calculateMatrix(self, voxelCoordinates)
91 matrix_args += [self.settings.get('kernelRadius', 1), voxelCoordinates]
92
---> 93 P_glszm = cMatrices.calculate_glszm(*matrix_args) # shape (Nvox, Ng, Ns)
94
95 # Delete rows that specify gray levels not present in the ROI

IndexError: Error filling GLSZM.

@daivagyapareek daivagyapareek changed the title [FEAT EXTRACTION] [FEAT EXTRACTION] - IndexError: Error filling GLSZM. Jan 26, 2021
@JoostJM
Copy link
Collaborator

JoostJM commented Jan 26, 2021

Which version of PyRadiomics did you install?

@JoostJM
Copy link
Collaborator

JoostJM commented Jan 26, 2021

Possibly related to #615, #617, #600, and fixed by #635 (part of the 3.0.1 release)

@JoostJM
Copy link
Collaborator

JoostJM commented Apr 7, 2021

Stale issue. Closing issue

@JoostJM JoostJM closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants