X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Apr 2008 03:02 PM by  anon
Error message in IDL while interfacing dcm4che
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 Apr 2008 03:02 PM
    Hi, I was trying to interface dcm4che2 to IDL to make a Dicomdir. The dcm4che has a dicomdir java file in the path org.dcm4che2.tool.dcmdir . I was able to pass a file as an object in the dicomdir java file. But, when i try calling a method from the java file which reads public int addFile( f ){ .... I get an error of NoClassFoundDefError ( this is after i did the exception handling code of IDL to show me the error) If anyone could guide me as to how I should progress from here or if anyone has previously worked on interfacing dcm4che with IDL, please do reply. It would be of great help. Thank you Rohit

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Apr 2008 03:02 PM
    Methods cannot throw 'NoClassFoundDefError', unless their argument is supposed to be an object and the argument is throwing the error. 'addFile' for example sounds like it might require a Java 'File' object. If you were passing instead an IDL filepath string, that would be a reason for a 'NoClassFoundDefError', I would think. For anyone in the Forum to understand your problem, you should probably show the syntax of all the object calls that are related to this error, then show as well the prototype for the 'addFile' method. James Jones

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Apr 2008 03:02 PM
    Hi James, Yes. I was trying to call using an IDL filepath string. The code for the addFile method is as follows: public int addFile(File f) throws IOException { int n = 0; if (f.isDirectory()) { File[] fs = f.listFiles(); for (int i = 0; i < fs.length; i++) { n += addFile(fs[i]); } return n; } DicomInputStream in = new DicomInputStream(f); in.setHandler(new StopTagInputHandler(Tag.PixelData)); DicomObject dcmobj = in.readDicomObject(); DicomObject patrec = ap.makePatientDirectoryRecord(dcmobj); DicomObject styrec = ap.makeStudyDirectoryRecord(dcmobj); DicomObject serrec = ap.makeSeriesDirectoryRecord(dcmobj); DicomObject instrec = ap.makeInstanceDirectoryRecord(dcmobj, dicomdir.toFileID(f)); DicomObject rec = writer().addPatientRecord(patrec); if (rec == patrec) { ++n; } rec = writer().addStudyRecord(rec, styrec); if (rec == styrec) { ++n; } rec = writer().addSeriesRecord(rec, serrec); if (rec == serrec) { ++n; } if (n == 0 && checkDuplicate) { String iuid = dcmobj.getString(Tag.MediaStorageSOPInstanceUID); if (dicomdir.findInstanceRecord(rec, iuid) != null) { System.out.print('D'); return 0; } } writer().addChildRecord(rec, instrec); System.out.print('.'); return n + 1; } I do not know if anyone here has used the dcm4che tool which is available on the website www.dcm4che.org All I am following is: 1. Take an image input from IDL. 2. Make an object of that using the java.util.File option. 3. Pass that object into the dicomdir java file which has an add file option. It is a big chunk of file I know. But, if you or anyone can think of a shortcut way for me to pass an image into this file and then get a dicomdir out of it, It would be great!!! Thank you Rohit
    You are not authorized to post a reply.