La matriz de destino DICOM malvada no era lo suficientemente larga, verifique el índice de destino y la longitud y los límites inferiores de la matriz

I am using EVIL DICOM image reader, it works well with some files, but some files give me this error: destination array was not long enough check destindex and length and the array's lower bounds I can't find the original website where I have purchased the program. Would appreciate any assistance.

preguntado el 25 de agosto de 12 a las 03:08

The error message is a general .NET message. Please provide more detailed information of where the error is occurring and if possible a stack trace. The "classic" Evil DICOM library can be downloaded from aquí. There is also a substantially re-worked new library available aquí. -

Thank you Anders, the error is in this line: im = new ImageMatrix(openFileDialog.FileNames, progressBar1, progressLabel);Line 22 in the EvilDicomImageReader program, Form1.cs. I did download the new DLL. Any idea how I contact the developer. -

1 Respuestas

By looking at the Evil DICOM code (version 0.5.7), I assume that you are using the ImageMatrix constructor in a way that was not entirely planned for.

The constructor you are referring to takes an array of DICOM image files, where the size of each image is supposed to be the same for all images.

Upon construction, the Image array property is dimensioned to equal the size of one image times the length of the DICOM image array in the private method IntializeMatrix.

Next, the constructor loops over all image files and inserts the pixel data from each file into the Image propiedad en el AppendImageToMatrix method. The start position of the copied pixel data in the Image is determined by the DICOM file ImageNumber.

Si ImageNumber is too high in relation to the size of the Image array, pixel data is copied to position 0 in the Image formación.

¡Sin embargo! If the start position is igual a la longitud del Image array, which will happen if the ImageNumber is exactly one more than the number of files, the start position will not be modified and there will be an attempt to write to a non-existing position in the Image ¡formación!

The line where this is happening is the fourth line in AppendImageToMatrix, Que dice lo siguiente:

if (offset > Image.Length) { offset = 0; }

If you are building the library yourself, you might want to change the > operador a un >= operator, then the application will at least not throw. Alternatively, you could consider a more fail-safe handling altogether of the pixel data copying. There is not room to elaborate on that here, though :-)

I cannot right away find the ImageMatrix clase en el updated version of Evil DICOM. However, if you run into problems with the old or the new code, consider reporting these problems on the Pestaña problemas of the Evil DICOM Github repository.

ACTUALIZACIÓN Tenga en cuenta que ImageNumber property is equal to the DICOM attribute Instance Number, tag (0020,0013).

Respondido 25 ago 12, 22:08

Thank you Anders, I will have to wait until Monday for one of my experience programmers; meanwhile I would like to know if Evil DICOM can read CAD Images (Animated DICOM). - hcl

I am pretty sure Evil DICOM is no capable of handling animated DICOM images, but I do not know for certain. - Anders Gustafsson

To follow up: I have now also reproduced the exact same error by following the above description. By changing to >= the exception went away. So, the above answer was not just guess-work :-) - Anders Gustafsson

Thanks again for you support. I did change offset > to offest >= in class ImageMatrix. Changed the reference in ImageReader to then new DLL, I got the same error! I am using EVILDICOM 3.5 library. Thanks - hcl

Thank you again for your support, you are right; I rebuilt the program using the new DLL (downloaded) it it worked well, however for CAD CT image it did not. The Library 3.5 is the .Net that I have purchased in Febraury, the DLL was version 4. Thanks again Anders. - hcl

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.