Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 08 02:15
    chen-wu commented #1175
  • May 07 20:39
    MartinOrtiz commented #1175
  • May 07 20:34
    EdwardMarcus commented #1175
  • May 07 20:33
    MartinOrtiz commented #1175
  • May 07 20:31
    EdwardMarcus commented #1175
  • May 07 20:29
    MartinOrtiz commented #1175
  • May 07 20:23
    MartinOrtiz commented #1175
  • May 07 20:19
    EdwardMarcus commented #1175
  • May 07 20:01
    MartinOrtiz commented #1175
  • May 07 12:44
    EdwardMarcus commented #1175
  • May 07 08:49
    chen-wu commented #1175
  • May 06 12:42
    EdwardMarcus commented #1175
  • May 06 09:45
    MartinOrtiz commented #1175
  • May 06 09:43
    MartinOrtiz commented #1175
  • May 04 20:27
    MartinOrtiz commented #1175
  • May 04 20:17
    EdwardMarcus commented #1175
  • May 04 20:12
    MartinOrtiz commented #1175
  • May 04 20:09
    MartinOrtiz commented #1175
  • May 04 19:57
    BobSter3000 commented #1161
  • May 04 19:51
    EdwardMarcus commented #1175
Reinhard Gruber
@gofal
@joeymeyer1986_gitlab Your code is accessing the raw pixel data. In DICOM the pixel data may be stored in many different formats: there can be color-pixels with 3 bytes per pixel (rgb), most of the time there are grayscale values in 12 bit depth with 2 bytes per pixel, sometimes there are only grayscale values in 8 bit depth with 1 byte per pixel. You have to evaluate some values from DICOM header to get to know how to interpret hte pixel data.
So using the PixelData directly is an option if you pretty much know how to interpret the pixel data. If you "only" want to render the image, then use the rendering engine. Fo-dicom does all this interpretataion for you then. See here: https://github.com/fo-dicom/fo-dicom/wiki/Image-rendering
kchicagualar
@kchicagualar
Hello, I have a Structured Report that I have parsed from XML to .dcm, and now I have to add this report into an existing study in my PACS, I don't understand how to accomplish this, do I have to add it to a dicomdirectory?, create a new serie from the study UID? Thanks in advance...
Reinhard Gruber
@gofal
@kchicagualar the second one is true. Create a new series with the same Patient-Data (0010,*) and the same StudyInstanceUID and the same study-related data, but with a new SeriesInstanceUID and new appropriate series-related data. The dicomdirectory is then later created by a CD burning machine.
Bob Woods
@BobSter3000
@gofal I am playing around with version 5, WPF and DI. This may be a stupid question. I add a DicomServer to the container with AddDicomServer and my own implementation of DicomService. I see it start and listening when the app starts.
How do I get the Dicom Server back out in a viewmodel contructor? Do I have to use IDIcomServerRegisty or is there a more direct way to access the instance of Dicom Server? Any guidance would be appreciated. Thanks again for all the hard work, 5 is looking pretty awesome.
Bob Woods
@BobSter3000
@gofal Disregard my question. Thanks again.
Reinhard Gruber
@gofal
@BobSter3000 great to hear to are investigationt version 5. yes, IDicomServerRegistry should to the job. And if you have any suggestions or feedback about version 5 then feel free to discuss it here, open github isse, or just send me in private chat.
Bob Woods
@BobSter3000
@gofal Thanks I appreciate it. One thing I am struggling with is the transcoder. This is a .NET 5 test project. The image is JPEG 2000 Lossless encoded. I am forcing the SCP, I am sending to, to only negotiate JPEG Lossless. When I add additional presentation contexts to the client it successfully negotiates the JPEG Lossless transfer syntax, but the transcoding fails. The client does not send any pixel data. I thought the default transcode manager would take care of the conversion in version 5. Perhaps I am not registering something correctly. Any ideas?
Bob Woods
@BobSter3000
@gofal Again disregard the transcoder question. I do not know what I was thinking. I had to register the NativeTranscoderManager, AddTranscoderManager<NativeTranscoderManager>. For some reason I was thinking the default transcoder was the native transcoder. Its all working now.
Reinhard Gruber
@gofal
@BobSter3000 Yes, the transcoder is a big thing. Because implementing a codec is very hard and I would not be able to fix something in this c++ code. The codec delivered with fo-dicom since ancient times only works in windows. but fo-dicom should be platform independet. I was relieved that the company Efferent health migrated the codec also to run on unix and mac and implemented an transcoder. The current state is, that the developer has to reference fo-dicom.codecs nuget package additionally. But of course it would also be possible, that fo-dicom.core references fo-dicom.codec and adds it's transcoder manager by default. that would mean everyone using fo-dicom will also download the codec, no matter if it is needed or not.
I am unsure about that. including the codec package by default would save the user 1 line of code. But it would increase the size of the fix downloaded a lot. and it would be contrary to the intention of the nuget packages. because the fo-dicom.codec references fo-dicom.core and implements the ITranscoderManager interface.
But this is one part, that of course if open to discussion
Bob Woods
@BobSter3000
@gofal Thanks again for the help, I do appreciate it. I am really liking the changes in version 5.
marcus1991
@marcus1991:matrix.org
[m]
Hey. I'm having some performance issues with fo-dicom, specifically with a CStoreSCP server. Using the code from https://github.com/fo-dicom/fo-dicom-samples/tree/master/Desktop/C-Store%20SCP, receiving a study takes ~24s. Receiving the same study with the storescp program from DCMTK takes ~14s. Before disabling Nagle's algorithm DCMTK took even longer than fo-dicom, but fo-dicom seems to disable it by default. Do you have any tips on how to make CStoreScp perform better with fo-dicom?
marcus1991
@marcus1991:matrix.org
[m]
:point_up: Edit: Hey. I'm having some performance issues with fo-dicom, specifically with a CStoreSCP server. Using the code from https://github.com/fo-dicom/fo-dicom-samples/tree/master/Desktop/C-Store%20SCP, receiving a study takes ~24s. Receiving the same study with the storescp program from DCMTK takes ~14s. Before disabling Nagle's algorithm DCMTK took even longer than fo-dicom, but fo-dicom seems to disable it by default. Do you have any tips on how to make CStoreScp perform better with fo-dicom? I'm using fo-dicom.NetCore 4.0.7 with .Net 5.
marcus1991
@marcus1991:matrix.org
[m]
:point_up: Edit: Hey. I'm having some performance issues with fo-dicom, specifically with a CStoreSCP server. Using the code from https://github.com/fo-dicom/fo-dicom-samples/tree/master/Desktop/C-Store%20SCP, receiving a study takes ~24s. Receiving the same study with the storescp program from DCMTK takes ~14s. Before disabling Nagle's algorithm DCMTK took even longer than fo-dicom, but fo-dicom seems to disable it by default. Do you have any tips on how to make CStoreScp perform better with fo-dicom? I'm using fo-dicom.NetCore 4.0.7 with .Net 5 on Windows 10.
Reinhard Gruber
@gofal
@marcus1991:matrix.org you could implement the handling of CStoreRequests in new threads to that you return the CStoreResponse as soon as possible, since this may block the next cstorerequest. So while one thread saves the file to the disk the next image is returning via network. But in general I would say that dcmtk will always be faster, because it's written in pure c++ while fo-dicom is managed language dealing with garbage collection, runtime checks, jit compilation the first time you call a application,... There may be some tricks how to optimize .net code at runtime but there I cannot help you. Maybe someone else?
2 replies
Petr Pelnar
@PelnarPetr_twitter

Hi team, @gofal , I have a question on encoding/SpecificCharacterSet. I have figured out how to sent data in UTF8/Unicode. I first set attribute for the dataset to SpecificCharacterSet, "ISO_IR 192" and then then using national characters, I add them with unicode Encoding, like this:
dataset.Add(new DicomPersonName(DicomTag.PatientName, Encoding.UTF8, procedure.Patient.Surname, procedure.Patient.FirstName))

However I am not sure how to do the same if I want to use a specific character set ISO_IR 101? I always see "?" instead of the extra characters I want to use, for example "í".
Should define the
result.Add(DicomTag.SpecificCharacterSet, "ISO_IR 101");
and then use Encoding for ISO_IR 101? But how?
Thanks!

Petr Pelnar
@PelnarPetr_twitter
Ok, I've got it. Sometimes it's enough to ask the qustion and you figure out;)
result.Add(new DicomPersonName(DicomTag.PatientName, DicomEncoding.GetEncoding("ISO_IR 101"), procedure.Patient.Surname, procedure.Patient.FirstName))
Reinhard Gruber
@gofal
@PelnarPetr_twitter Yes, you found the solution. OR: you are upgrading to version 5. There you call result.Add(new DicomPersonName(DicomTag.PatientName, procedure.Patient.Surname, procedure.Patient.FirstName) and result.Add(DicomTag.SpecificCharacterSet, "ISO_IR 101") in any order without setting the encoding twice.
StanislavKoncebovski
@StanislavKoncebovski
Hello, I am at my first steps with fo-dicom (previously worked with other DICOM frameworks for C# and C++). I am trying to save instances of DicomImage on a database and fetch them from there. (Concretely, this is LiteDB, but the type of the DB is irrelevant IMHO). I can download the image from the DB to a memory stream, and then open a DicomFile from the stream and build the image from the dataset of the latter, like this:
MemoryStream ms = new MemoryStream();
this._pictureStorage.Download(instanceUID, ms); // getting the stream from the DB
ms.Flush();
ms.Position = 0;
DicomFile dicomFile = DicomFile.Open(ms);
if (dicomFile != null)
{
DicomImage image = new DicomImage(dicomFile.Dataset);
return image;
}
Reinhard Gruber
@gofal
@StanislavKoncebovski yes, exactly. Then with the DicomImage instance you can change windowing, scale etc. and call RenderImage() to get a image to be displayed on screen.
StanislavKoncebovski
@StanislavKoncebovski
@gofal Thanks Reinhard. Does it mean, it is OK to leave the streams unclosed?
@gofal BTW I do not see the end of my entry here (with all the questions). Did you get them? Is there any length constraint of an entry?
Petr Pelnar
@PelnarPetr_twitter
Hi, I am trying to push a fix of a bug I have found in version 4 (#1163) but I am getting an error
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
unable to access 'https://github.com/fo-dicom/fo-dicom.git/': The requested URL returned error: 403
Do I need to ask for permissions on the repo?
I would like to start contributing when I get some free cycles and finding this bug looked like a good reason to start..
Reinhard Gruber
@gofal
@PelnarPetr_twitter Great to hear you want to contribute, thanks! Yes, you cannot push directly into fo-dicom/fo-dicom. the usual workflow on github is, that you fork the fo-dicom project into your own github-account (github.com/pelnarPetr/fo-dicom for example). There you do the changes (e.g. in a branch) and create a pull request into fo-dicom/fo-dicom (https://github.com/firstcontributions/first-contributions)
Jesse Clark
@jesst3r
Greetings, is there are way to connect to the TLS secured PACS (with certificate), with fo-dicom and perform C-GET request?
alimahmoudh
@alimahmoudh
Hello @all am using .net core 3.1 and am new to Fo-dicom I have stream of compressed 70 jpeg how to read it and decompress it in fo dicom
alimahmoudh
@alimahmoudh
I don't have the physical dcm file instead I get pixel data via wado call
TheDevTom
@TheDevTom
I'm curious if anyones had any luck with the ole fo-dicom in il2cpp? DicomFile.Open is failing with The type initializer for 'Dicom.DicomEncoding' threw an exception. and seeing the threads on the issue tracker seems others have too!
Jussi Mattila
@jussimattila
Does DicomAnonymizer respect the list of safe private tags from here: http://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.10.html#table_E.3.10-1?
Dominik Ruman
@druman-ff
Hi, When sending multiple (eg. 10) CStoreRequest in a single client.SendAsync() and eg. second request fails, do all other (3..10) requests still are euqueued to send, or sending stops?
GeovaneW96
@GeovaneW96
Does anyone know if it's possible to reference a library that use fo-dicom Mono from a Cocoa App? I've been struggling with it and getting the error the Dicom.Core and CSJ2K reference PresentationCore
Shivansh1291
@Shivansh1291

I was using MyDICOM.net and got the below conversion for tag values automatically

BodyPartExamined- Procedure05_åöäÅÖÄX Converted value -Procedure05_evdEVDX

But Fo Dicom is converting it to Procedure05_??????X. How can i fix this?

and this is valid for all other tags
It works fine for all other tags when i use the below
dataset.Add(global::Dicom.DicomTag.SeriesDescription, Encoding.Default, info.Procedure);
but the BodyPartExamined tag remains the same
Ali.H
@aria321

Hello all, I am saving frames of FilmBased DCM such as US and XA modalities files as below, but all the images are the same :
`

FoDicom.Imaging.DicomPixelData pixedData = FoDicom.Imaging.DicomPixelData.Create(df);
for (int i = 0; i <= pixedData.NumberOfFrames - 1; i++)
{
    try
    {
        //var image = pixedData.GetFrame(i);
        var image = new FoDicom.Imaging.DicomImage(df, i);
        if (image != null)
        {
            string imgFileName = $"{imageDirectory}\\IM{i + 1:D5}.jpg";
            df.Remove(FoDicom.DicomTag.WindowCenter, FoDicom.DicomTag.WindowWidth);   
            using (var iimage = image.RenderImage())
            {
                iimage.AsSharedBitmap().Save(imgFileName, System.Drawing.Imaging.ImageFormat.Jpeg);
            } 
        }
    }
    catch (Exception exp)
    {
        logging.Log(LoggingMode.Error, $"Saving image {i} failed, EXP:{exp}");
    }
}

`

Ali.H
@aria321
The problem resolved by passing frame number to RenderImage() as image.RenderImage(i) but what is var image = new FoDicom.Imaging.DicomImage(df, i);
Reinhard Gruber
@gofal
@jesst3r The DicomClient constructor has a parameter useTls, with that the client creates a secured network connection.
@jussimattila I am affraid, these are not implemented. But this would be a gread enhancement :-)
Reinhard Gruber
@gofal
@druman-ff depeding on what you mean by "the request failes". the dicomclient sends a request and reads the response, then continues with the next request. So if the request fails in that way, that you get a response that contains some error code, then the other requests continue to be sent. because DicomClient does not parse the content of the response. But very often a failing request causes the server to abort the association. In that case the association will be closed by DicomClient and the requests that are still in the queue will not be sent.
@aria321 Agree, the frame parameter in constructor does not make any sense. I assume it is still here for historical reasons. Would be a good enhancement to consolidate this either remove the parameter in the costructor or to use this value if RenderImage is called without parameter.
gasupidupi
@gasupidupi
Hi, just a question out of curiosity. The IDicomClient interface doesn't define all properties of the DicomClient. Namely it misses the Host, Port, UseTls, CallingAe, CalledAe and IsSendRequired properties. Is there some specific reason for this? I just realized when I wanted to do dependency injection. It's not a problem because there's workarounds for that, but I'm just wondering
Reinhard Gruber
@gofal
IDicomClient is an older interface. When it was created, these properties you mention have not been properties of DicomClient, but they were passed as parameter of the method SendAsync. This made it possible to use the same DicomClient instance for several different connections, which caused errors. So we changed the behavior in that way that the connection parameters are now passed via constructor, so having one DicomClient per connection. With that step the properties you mentioned where added to DicomClient class, but we did not forward it do IDicomClient interface for no specific reason. If you would need it in interface, then feel free to create a pull request and add them.
gasupidupi
@gasupidupi
Thank you for explaining @gofal ! I've created a PR with the added properties
Thomas Boby
@tboby

I'm trying to use fo-dicom inside a Windows base container but am struggling with Efferent.Native.dll throwing an "External component has thrown an exception" exception, with a stack of :

  at Efferent.Native.Codec.Jpeg.JpegCodec.jpeg_std_error_8_Windows64(jpeg_error_mgr& err)
   at Efferent.Native.Codec.Jpeg.JpegCodec.Decode(DicomPixelData oldPixelData, DicomPixelData newPixelData, DicomJpegParams jpegParams, Int32 frame)
   at Efferent.Native.Codec.DicomJpegNativeCodec.Decode(DicomPixelData oldPixelData, DicomPixelData newPixelData, DicomCodecParams parameters)
   at Dicom.Imaging.Codec.DicomTranscoder.Decode(DicomDataset oldDataset, DicomTransferSyntax outSyntax, IDicomCodec codec, DicomCodecParams parameters)
   at Dicom.Imaging.Codec.DicomTranscoder.DecodeFrame(DicomDataset dataset, Int32 frame)
   at Dicom.Imaging.DicomImage.GetFrameIndex(Int32 frame)
   at Dicom.Imaging.DicomImage.RenderImage(Int32 frame)

My project is targeting .net5.0, and this same code runs in a linux dotnet/sdk:5.0 container fine.
I didn't have any luck with dotnet/sdk:5.0 windows, due to missing assembly dependencies.
I'm now trying dotnet/framework/sdk:4.8 which seems to load the dlls, but fails in a strange way.
If I run the same code outside the container on my windows host it's fine.
Any ideas how I can get the actual error?

I actually managed to get dotnet/sdk:5.0 to get to the same error by including "onecore" VC140 redists, but I assumed it was still a loading problem at the time
Using fo-dicom 4.0.7, Efferent.Native 4.0.0
Thomas Boby
@tboby
Swapping back to net5.0-windows and using the built-in transcoder I then get GDIP missing exceptions, which presumably means Server Core images don't have gdiplus.dll?