Prev: bimodal histogram
Next: beginner loop m file question
From: Zubin on 31 May 2010 06:47 Hey all, I made a GUI that opens and processes a stack of CT images in a certain way. The GUI runs just fine within Matlab and when I compiled it into an executable, it still works correctly apart from one small aspect. There is one button which calls ImTool and allows the user to see the CT image at different Window settings. When I'm running from within Matlab, it works just fine, but in the compiled version, that one button gives me an error in the dos console. The error says that I'm not using the imtool command correctly for the given data type. The error seems to be related to the fact that they're DICOM (CT) images and that they're signed 16bit values but I'm not sure how to resolve it. I've tried converting the loaded image into a signed/ unsigned int16 image but I'm not sure if I'm on the right track. This is the code I'm running for that particular button: fnames=get(handles.listbox1,'String'); %getting the file name etc findex=get(handles.listbox1,'Value'); fn1=char(fnames(findex)); I=dicomread(fn1); % reading the image imtool(I, [700 1000]); % the brackets specify the initial display range I went through the help for Imtool and it seems that you have to specify something special for signed 16bit images. I tried a few variations of the Imtool command but none of them worked in the executable version of the program. I've already tired using these: imtool(I); imtool(I, []); imtool(I, [700 1000]); imtool(I,'DisplayRange', []); imtool(I,'DisplayRange', [700 1000]); Anyone has any ideas of how to structure my imtool statement or if I need to convert the image into a signed/unsigned 16bit image, please let me know. Thanks a lot!!!! Zubin.
From: us on 31 May 2010 07:33 Zubin <masterzubin(a)gmail.com> wrote in message <b1d45213-df52-4777-b71d-b9e3ea0b54f7(a)s1g2000prf.googlegroups.com>... > Hey all, > > I made a GUI that opens and processes a stack of CT images in a > certain way. The GUI runs just fine within Matlab and when I compiled > it into an executable, it still works correctly apart from one small > aspect. There is one button which calls ImTool and allows the user to > see the CT image at different Window settings. When I'm running from > within Matlab, it works just fine, but in the compiled version, that > one button gives me an error in the dos console. The error says that > I'm not using the imtool command correctly for the given data type. > > The error seems to be related to the fact that they're DICOM (CT) > images and that they're signed 16bit values but I'm not sure how to > resolve it. I've tried converting the loaded image into a signed/ > unsigned int16 image but I'm not sure if I'm on the right track. > > This is the code I'm running for that particular button: > fnames=get(handles.listbox1,'String'); %getting the file name etc > findex=get(handles.listbox1,'Value'); > fn1=char(fnames(findex)); > I=dicomread(fn1); % reading the image > imtool(I, [700 1000]); % the brackets > specify the initial display range > > I went through the help for Imtool and it seems that you have to > specify something special for signed 16bit images. I tried a few > variations of the Imtool command but none of them worked in the > executable version of the program. I've already tired using these: > imtool(I); > imtool(I, []); > imtool(I, [700 1000]); > imtool(I,'DisplayRange', []); > imtool(I,'DisplayRange', [700 1000]); > > Anyone has any ideas of how to structure my imtool statement or if I > need to convert the image into a signed/unsigned 16bit image, please > let me know. Thanks a lot!!!! > > Zubin. well... did you try what you say (the simple solution): convert your image and see what happens... us
From: Zubin on 31 May 2010 07:43 Well I did try to convert to Uint16 and Int16 (I'm not sure what the correct one is). CT DICOM images should be signed 16-bit images but they show up as Uint16 in the workspace. Anyway I tried converting the loaded image to both formats I2=int16(I); or I2=uint16(I); and calling imtool on I2 instead of I, but no joy. Could it be some issue with the compiler? Maybe Imtool is not part of that particular MCR. I'll try adding it to the package while compiling. Maybe that will help. Will try it first thing when I get home.
From: Zubin on 31 May 2010 14:05 Here is the exact error that I'm getting. Undefined function or method 'imtool' for input arguements of type 'uint16' If anybody has any idea why this error occurs, I'd really appreciate the help. Thanks.
From: Walter Roberson on 31 May 2010 14:25
Zubin wrote: > Here is the exact error that I'm getting. > > > Undefined function or method 'imtool' for input arguements of type > 'uint16' > > > If anybody has any idea why this error occurs, I'd really appreciate > the help. If I recall correctly, imtool cannot be compiled. Ah yes, I am right: http://www.mathworks.com/products/compiler/compiler_support.html |