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

StackViewer not working due to offset "out of bounds" #306

Closed
JwRicauter opened this issue Nov 23, 2022 · 1 comment
Closed

StackViewer not working due to offset "out of bounds" #306

JwRicauter opened this issue Nov 23, 2022 · 1 comment

Comments

@JwRicauter
Copy link

Hi,

I have my app that it was working nice, but suddenly this error jumps out:

Uncaught (in promise) RangeError: offset is out of bounds at Float32Array.set (<anonymous>) at StackViewport._updateVTKImageDataFromCornerstoneImage (StackViewport.ts:1366:1) at StackViewport._updateActorToDisplayImageId (StackViewport.ts:1720:1) at StackViewport.successCallback (StackViewport.ts:1559:1) at StackViewport.ts:1584:1

I don't know what's happening because the image stack viewer was working. I have in my backend NIFTI files from wich I divide it into dicom files and send it to the client.

`
class DicomWeb(generics.GenericAPIView):

class DicomRenderer(renderers.MultiPartRenderer):
    media_type = 'multipart/related; type=application/octet-stream; transfer-syntax=*'

    def render(self, data, accepted_media_type=None, renderer_context=None):
        return data

renderer_classes = (DicomRenderer,)

def get(self, request, study, series, instance, frame):
    case_id = study
    img_id = series
    series_dcms_dir = get_series_dcms_dir(case_id, img_id)
    dicom_path = f'{series_dcms_dir}/{instance}.dcm'
    dicom = pydicom.dcmread(dicom_path)
    data = {}
    data[str(dicom_path)] = (
        'dicomfile', dicom.PixelData, 'application/dicom')

    # encode as multipart_related
    body, content_type = encode_multipart_related(fields=data)
    response = HttpResponse(body, status=200)
    response['Content-Type'] = 'binary/octet-stream'
    return response

`
any clue?

@sedghi sedghi closed this as completed in d8f05ff Jan 27, 2023
@andrei0807
Copy link

Same issue
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants