I am trying to integrate my own local server with OHIF viewer and it's sending a response to OHIF viewer till instances but it doesn't display images on Viewer and gives an error
Error Occurred invalid response: no multipart mime type header
I am using dotnet core for my server and sending image data as follows ( I am using fo-Dicom)
`public async Task<IActionResult>Getstudy(string SUID,string SeUID,string img)
{
var folderName = Path.Combine("StaticFiles", "Images");
var fileName = folderName + '/'+ img;
string temp = ".dcm";
fileName = fileName + temp;
var file1 = DicomFile.Open(fileName);
DicomDataset dataset = file1.Dataset;
dataset.Add<string>(DicomTag.MIMETypeOfEncapsulatedDocument,"application/related");
DicomPixelData pixelData = DicomPixelData.Create(dataset);
byte[] originalRawBytes = pixelData.GetFrame(0).Data;
return File(originalRawBytes, "multipart/related");
}`
I don't know if it's the correct way and i would really appreciate if someone helps me to connect my local server with OHIF viewer !!
Following is the error:
index.umd.js?d226:9505 Error: invalid response - no multipart mime header
at eval (cornerstoneWADOImageLoader.min.js?9f0f:2)
@jaizz2003 your code is definitely not sending a multi-part response to the viewer. If you want to build your own local server then you need to research how to send multipart in .NET and understand the DICOMweb standard thoroughly.
If you use WADO-URI in OHIF rather than WADO-RS then you can send a DICOM file and no need for multi-part. However, you should know what the difference between both services are to use it properly.
Not sure why you need to build a custom server when there are some other open-source alternatives. Implementing a custom DICOMweb server is a huge and probably unnecessary undertaking.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@jaizz2003 your code is definitely not sending a multi-part response to the viewer. If you want to build your own local server then you need to research how to send multipart in .NET and understand the DICOMweb standard thoroughly.
If you use WADO-URI in OHIF rather than WADO-RS then you can send a DICOM file and no need for multi-part. However, you should know what the difference between both services are to use it properly.
Not sure why you need to build a custom server when there are some other open-source alternatives. Implementing a custom DICOMweb server is a huge and probably unnecessary undertaking.