Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
|
||
| return typeof imageObj.getImageId === 'function' ? imageObj.getImageId() : imageObj.url; | ||
| }; | ||
|
|
There was a problem hiding this comment.
Removed function still called causing runtime crash
High Severity
The getImageId function was removed from this file, but it's still called at two locations: in findImageIdOnStudies (returning getImageId(instance)) and in getImageInstanceId (returning getImageId(imageInstance)). Any code path reaching these functions will crash with a ReferenceError. The DICOM loader service will be completely broken for local data retrieval and image type detection workflows.
Additional Locations (1)
Additional Comments (2)
Prompt To Fix With AIThis is a comment left during a code review.
Path: extensions/cornerstone/src/utils/dicomLoaderService.js
Line: 17:17
Comment:
`getImageId` function was deleted but is still called here - will cause `ReferenceError: getImageId is not defined` at runtime
```suggestion
return instance?.getImageId?.() ?? instance?.url;
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: extensions/cornerstone/src/utils/dicomLoaderService.js
Line: 36:36
Comment:
`getImageId` function was deleted but is still called here - will cause `ReferenceError: getImageId is not defined` at runtime
```suggestion
return imageInstance?.getImageId?.() ?? imageInstance?.url;
```
How can I resolve this? If you propose a fix, please make it concise. |
There was a problem hiding this comment.
Pull request overview
This PR removes a getImageId helper function from the dicomLoaderService utility file. However, the PR appears to be incomplete and contains a critical bug.
Changes:
- Removed the
getImageIdhelper function (lines 6-14) fromdicomLoaderService.js
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -3,14 +3,6 @@ import dicomImageLoader from '@cornerstonejs/dicom-image-loader'; | |||
| import { api } from 'dicomweb-client'; | |||
| import { DICOMWeb, errorHandler } from '@ohif/core'; | |||
|
|
|||
There was a problem hiding this comment.
Removing the getImageId function will break the code. This function is still referenced in two places within this file:
- In
findImageIdOnStudies(line 17 in the updated file):return getImageId(instance); - In
getImageInstanceId(line 36 in the updated file):return getImageId(imageInstance);
These references will cause ReferenceError at runtime when either function is called. Before removing this function, you need to either:
- Import a replacement from another module (if one exists in @ohif/core utils)
- Inline the function logic at the call sites
- Keep this function definition
| const getImageId = instance => { | |
| return instance && instance.imageId; | |
| }; |
Viewers
|
||||||||||||||||||||||||||||
| Project |
Viewers
|
| Branch Review |
test/greptiles
|
| Run status |
|
| Run duration | 02m 33s |
| Commit |
|
| Committer | Alireza |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
37
|
| View all changes introduced in this branch ↗︎ | |


Context
Changes & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Note
High Risk
Removes the
getImageIdhelper from a core DICOM loading utility, butdicomLoaderService.jsstill callsgetImageId, which is likely to cause runtime failures when resolving image IDs and retrieving DICOM data.Overview
Removes the local
getImageIdhelper fromextensions/cornerstone/src/utils/dicomLoaderService.js, changing how image IDs are expected to be resolved.Note: the file still calls
getImageId(e.g., infindImageIdOnStudiesandgetImageInstanceId) without defining or importing it, which likely breaks DICOM retrieval at runtime.Written by Cursor Bugbot for commit e4c4df0. This will update automatically on new commits. Configure here.
Greptile Overview
Greptile Summary
This PR removes the
getImageIdhelper function fromdicomLoaderService.jswithout removing its usages, causing critical runtime errors.getImageIddeleted but still called on lines 17 and 36findImageIdOnStudiesorgetImageInstanceIdwill throwReferenceError: getImageId is not definedConfidence Score: 0/5
Important Files Changed
getImageIdhelper function but left 2 call sites, causing ReferenceErrorSequence Diagram
sequenceDiagram participant Client participant DicomLoaderService participant findImageIdOnStudies participant getImageInstanceId participant getImageId Client->>DicomLoaderService: findDicomDataPromise(dataset, studies) DicomLoaderService->>DicomLoaderService: getLocalData(dataset, studies) DicomLoaderService->>getImageInstanceId: getImageInstanceId(instance) getImageInstanceId->>getImageId: getImageId(imageInstance) Note over getImageId: ❌ DELETED FUNCTION<br/>Still called on line 36 getImageId-->>getImageInstanceId: ReferenceError DicomLoaderService->>findImageIdOnStudies: findImageIdOnStudies(studies, displaySetInstanceUID) findImageIdOnStudies->>getImageId: getImageId(instance) Note over getImageId: ❌ DELETED FUNCTION<br/>Still called on line 17 getImageId-->>findImageIdOnStudies: ReferenceError(2/5) Greptile learns from your feedback when you react with thumbs up/down!