Code Monkey home page Code Monkey logo

mdcm's People

Watchers

 avatar

mdcm's Issues

Mutual recursion between classes Dicom.Implementation and Dicom.Data.DicomUID throws NullReferenceException

There seems to be a bug due to mutual recursion between
Dicom.Implementation.ClassUID and Dicom.Data.DicomUID.InstanceRootUID.

In detail, here's what happens:

1. Dicom.Implementation.ClassUID is of type DicomUID, and it's a static
field (assigned when the class is first used, right?).

2. Use the class Dicom.Implementation in any way you like. Anything will do,
System.Console.WriteLine(Dicom.Implementation.Version) is enough.

3. This triggers the initialization of the ClassUID field, and to assign
it, a DicomUID instance will be created.

4. As this is the first time we're using DicomUID the static fields should
be set. One of the field is InstanceRootUID which when initialized will
eventually use ClassUID of Dicom.Implementation.

5. Dicom.Implementation.ClassUID is still null, as it's not yet assigned.

6. You will get a NullReferenceException.


This is the callstack, copy'n'pasted from VS:

Dicom.dll!Dicom.Data.DicomUID.Generate(Dicom.Data.DicomUID baseUid = null,
long nextSeq = 114354090805) Line 116
Dicom.dll!Dicom.Data.DicomUID.CreateInstanceRootUID() Line 82
Dicom.dll!Dicom.Data.DicomUID.DicomUID() Line 73
[Native to Managed Transition]  
[Managed to Native Transition]  
Dicom.dll!Dicom.Implementation.Implementation() Line 30


As far as I'm aware, this should be something that all users of the library
should see, and I'm a bit surprised nobody reported this until now?
Or maybe I've confused something... :)

My project using mDCM compiled and could listen to sockets, but when
receiving connections it failed during parsing PDUs.

I'm using the latest SVN Revision 66. I did not have this issue with SVN #64.

Original issue reported on code.google.com by [email protected] on 23 Oct 2009 at 3:05

DcmValueElement<T>.ParseNumber has no support for double and float types

What steps will reproduce the problem?
1. SetValueString(string) on DcmFloatingPointDouble and DcmFloatingPointSingle

What is the expected output? What do you see instead?
- Expected: value in object, instead ObjectNullReference because
ParseNumber returns null

What version of the product are you using? On what operating system?
- SVN revision 67

Please provide any additional information below.
- Attached patch which adds double and float to DcmValueElement<T>.ParseNumber

Original issue reported on code.google.com by [email protected] on 29 Jan 2010 at 10:13

Attachments:

Addition of non-ASCII string elements to DataSet results in an element with "?" instead of letters

A great library with clear code! Thank you!

What steps will reproduce the problem?
1. DcmDataset data = new DcmDataset(DcmTS.ImplicitVRLittleEndian);
2. String patientsName = 
"Фамилия-Пациента^Имя-Пациента^Отчество-Пац
иента";
3. data.AddElementWithValueString(DcmTags.PatientsName, patientsName);
OR
   data.AddElementWithValue(DcmTags.PatientsName, patientsName);
3. patientsName = data.GetElement(DcmTags.PatientsName).GetValueString();

Expected: 
  patientsName == "Фамилия-Пациента^Имя-Пациента^Отчество-Пациента"
Observed:
  patientsName == "???????-????????^???-????????^????????-????????"

I use mDCM loaded from SVN on 2009, July 2

As far as I inspected, the problem is in ByteBuffer, which posesses the 
default ASCII encoding. It is possible to create the desired element first 
with an empty value, then set its encoding, afterwards assign it the 
desired value. I would propose another solution below, which will work for 
SpecificCharacterSet with VM of 1 only.
1) DcmDataset is added a method SetSpecificCharacterSet(String), which 
stores internally the desired character set and adds the SpecificCharacterSet 
attribute to the dataset.
2) In the methods of DcmDataset that manage assignment of string values, 
namely AddElementWithValueString, SetString, and SetStringArray encoding of 
the added/changed tag is set to be the encoding of the data set (taken from 
the internal variable)

I would make the change if you wish to. Just contact me at kkarmakul at 
gmail dot com.

Sorry for the mess if the issue is deeper and the solution works for small 
set of cases.

Thank you!
  Kirill

Original issue reported on code.google.com by [email protected] on 3 Jul 2009 at 9:12

Dicoding of JPEG compress image

What steps will reproduce the problem?
1. IJpegCodec^ codec = GetCodec(precision, jparams);//around line no 68 in 
DcmJpegCodec.cpp
2.
3.

What is the expected output? What do you see instead?
Uncompress Image (Or original image); but the output is exception "Unable 
to determine bit depth: JPEG syntax error!" 

What version of the product are you using? On what operating system?
Windows XP

Please provide any additional information below.
The statement IJpegCodec^ codec = GetCodec(precision, jparams) is creating 
the problem it should be                                           
IJpegCodec^ codec = GetCodec(oldPixelData->BitsStored, jparams);
After correcting the above statement the problem is fixed .

Regards
Mahesh


Original issue reported on code.google.com by [email protected] on 6 Sep 2008 at 6:41

Incorrect Modality UID - Character Error ?

For some reasons, all of the MPPS SOP class have UIDs start with 1.-2.840...

>> public static DcmUID ModalityPerformedProcedureStepSOPClass = new
DcmUID("1.­-2.840.10008.3.1.2.3.3", "Modality Performed Procedure Step SOP
Class", UidType.SOPClass);

>> public static DcmUID ModalityPerformedProcedureStepRetrieveSOPClass =
new DcmUID("1.­-2.840.10008.3.1.2.3.4", "Modality Performed Procedure Step
Retrieve SOP Class", UidType.SOPClass);

>> public static DcmUID ModalityPerformedProcedureStepNotificationSOPClass
= new DcmUID("1.­-2.840.10008.3.1.2.3.5", "Modality Performed Procedure
Step Notification SOP Class", UidType.SOPClass);

I suspect this is an character/encoding error somehow, as when I copy/paste
it into this, the negative sign disappear . However, on my editor, and VS
2009, it's definitely there & causing some troubles.

==================
FYI: I am on WindowXP professional, Visual Studio 2008 Professional Edition

Original issue reported on code.google.com by [email protected] on 22 May 2009 at 2:50

OnReceiveAssociateRequest delegate can get called before the DicomClientCreatedDelegate

Seems to be a thread racing condition, the suggested solution below removes
all trouble for me and gives reliable, repeatable behavior.


To reproduce;
1. Use svn mDCM to write:

var server = new DcmServer<FooServer>();

server.DicomClientCreatedDelegate += new DicomClientCreatedDelegate((s, c,
st) => {

c.OnAssociationRequest = doSomethingHandler;
c.OnFooRequest = ...;

};

server.Start();

2. Use any DICOM tool to query the server.
3. In a few percent of the connects, DicomClientCreatedDelegate will not
have been called before DcmNetworkBase has read a DcmAssosiateRequest from
the socket.
Line 119 in DcmServer.cs;
handler.InitializeService(client);
will fork a thread to read from the socket.
Line 122 will call the delegate;
OnDicomClientCreated(this, handler, client.Type);


Expected behavior:
Given that DicomClientCreatedDelegate is recommended to use to set your
handlers (is it?), I would expect it to be called before
OnReceiveAssociateRequest (and others) are called.

Actual behaviour:
When testing, in roughly 5% of the cases DicomClientCreatedDelegate will
not have been called before OnReceiveAssociateRequest gets called.


Suggested solution:
Move calling DicomClientCreatedDelegate a few lines up, so it gets called
before handler.InitializeService(client) which kicks of the listener thread.


I'm using .NET 3.5 SP1 on Windows XP SP3.

Original issue reported on code.google.com by [email protected] on 21 Sep 2009 at 9:08

Need Int type inside Dicom.Data.DcmDataset.LoadDicomFieldValue for NumberOfStudyRelatedInstances

What steps will reproduce the problem?
1. Do a C-Find and try to get either NumberOfStudyRelatedSeries or
NumberOfStudyRelatedInstances - they will return zero

What is the expected output? What do you see instead?
The numbers should not be zero


What version of the product are you using? On what operating system?
.9.5 on Windows, compiling in VS C# Express 2008

Please provide any additional information below.

Okay, I think I found a minor bug inside
Dicom.Data.DcmDataset.LoadDicomFieldValue. In the block starting around like
875, it checks if vtype matches several types, but there is no check for an
Int32 (which is my NumberOfStudyRelatedInstances).  So I added this:

                      } else if (vtype == typeof(Int32)) {
                           string temp = elem.GetValueString();
                           return System.Convert.ToInt32(temp, 10);

around line 884.  Works.  :-)

Best Regards,
Aerik 


Original issue reported on code.google.com by [email protected] on 8 May 2008 at 10:53

VR of ST (Short Text) is created with isString==false

What steps will reproduce the problem?
1. DcmDataset data = new DcmDataset(DcmTS.ExplicitVRLittleEndian);
2. data.AddElementWithValue(DcmTags.InstitutionAddress, "Baker St. 221b, 
London, UK");

What is the expected output? What do you see instead?
Expected: a plain addition of Institution Address element to this DataSet
In real: an exception is thrown telling "Tried to create element with 
incorrect VR".

Please provide any additional information below.
It's a copy-paste mistake, I believe.
In DcmVR.cs, changing the isString parameter from "false" to "true" in line 
135 fixes the problem:
public static DcmVR ST = new DcmVR("ST", "Short Text", true, true, true, 
PadSpace, 1024, 1, VrRestriction.Maximum);



Original issue reported on code.google.com by [email protected] on 9 Jul 2009 at 8:38

pdustream.flush breaks cstoreclient

What steps will reproduce the problem?
1. send more than one study using a cstore client gets a dimse error and aborts


What is the expected output? What do you see instead?
should continue to next study

What version of the product are you using? On what operating system?
.9.5

Please provide any additional information below.
Per Colby, comment out pdustream.flush(true) in DcmNetworkBase, on about
line 1640

Original issue reported on code.google.com by [email protected] on 23 Jun 2008 at 5:23

Bug in DcmDataset.Dump()

There's a bug in DcmDataset, line 1096:

public void Dump(StringBuilder sb, String prefix, DicomDumpOptions options) {
            foreach (DcmItem item in _items.Values) {
                item.Dump(sb, prefix, DicomDumpOptions.Default);
                sb.AppendLine();
            }
        }

The functions always sends the default DumpOptions. Correct by replacing
with the options received in the function's arguments.

Original issue reported on code.google.com by [email protected] on 20 Apr 2009 at 2:18

Rle decoder constructor requires stream rewind to read rle header info

What steps will reproduce the problem?
1. initialzing the rledecoder class

What is the expected output? What do you see instead?
Expected output is the segment count and segment offsets

What version of the product are you using? On what operating system?
latest dicom codec codes win xp

Please provide any additional information below.

A simple fix (see inserted line  'stream.Position = 0;' shown below)

  #region Public Constructors
            public RLEDecoder(IList<ByteBuffer> data)
            {
                int size = 0;
                foreach (ByteBuffer frag in data)
                    size += frag.Length;
                MemoryStream stream = new MemoryStream(size);
                foreach (ByteBuffer frag in data)
                    frag.CopyTo(stream);
                BinaryReader reader = EndianBinaryReader.Create(stream, Endian.Little);
                stream.Position = 0;
                _count = (int)reader.ReadUInt32();
                _offsets = new int[15];
                for (int i = 0; i < 15; i++)
                {
                    _offsets[i] = reader.ReadInt32();
                }
                _data = new byte[stream.Length - 64]; // take off 64 bytes for the offsets
                stream.Read(_data, 0, _data.Length);
            }
            #endregion







Original issue reported on code.google.com by [email protected] on 25 Jun 2010 at 3:08

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.