From: Walter Roberson on
Eric Diaz wrote:

>> Are you aware that you can set the root property
>> DefaultFigureCreateFcn and that the function you nominate there can
>> add arbitrary toolbar entries using uipushtool ?

> I was not aware of that. I will look into that. hmmm...when I type in
> inspect(0), I don't see a DefaultFigureCreateFcn property. That's odd.
> I suppose it is just the same as the CreateFcn.

Sorry, lost track of this conversation when I moved between home and work.

Steve appears to have pointed you to the correct section of the documentation
for this functionality.

You can see the default properties that have been changed by using

get(0,'Default')

and you can see the factory defaults figure properties via

get(0,'FactoryFigure')

> Do you mean that the
> nominated function should be a uipushtool pushbutton?

There are two functions involved here, and I am not sure which of the two you
mean by 'nominated'. The first function is the one you would code as
'DefaultFigureCreateFcn'; that function I would have call uipushtool() in
order to add a reference to the second function as a figure pushbutton .

The second function involved is the one that would actually get invoked when
the button is pushed, and it would invoke the window/leveler functionality.
For example, instead of having to type imcontrast at the command window, the
second function could invoke imcontrast on your behalf, done via a mouse movement.

It might possibly be as simple as coding the uipushtool pushbutton callback as
{@(src,event) imcontrast(src)}


>> Interestingly, I have never encountered this term before, even though
>> we do a fair bit of medical imaging work. We do, though, tend to build
>> our own imaging tools, and the work I do tends to be more on MRS or on
>> features already extracted from images (MRI, infra red)

> That is interesting. Perhaps the vernacular isn't as common in all
> fields, however it is the vernacular of medical imagers. I suppose you
> would not need it for MRS (I assume you mean MR spectroscopy). Not sure
> what you mean by features already extracted...

Yes, MRS is MR Spectroscopy.

When I refer to working on "features already extract from images", what I mean
is most of the projects I have worked on do not use raw medical images, but
instead work on information that someone else (using some other tool) has
extracted from images. When we do work with images it is commonly a time
course, and we internally treat the data as multidimensional points with each
pixel corresponding to one feature. Our tools are not sensitive to scaling and
translation -- provided, of course, that reasonable precision is maintained.
Our tools do have problems if you do the equivalent of setting the contrast to
the maximum or minimum ;-)
From: Eric Diaz on
Dear Us, Steven and Walter

Thanks for the tips on the create Fcn. I'll check these out.

Dear Walter,

> There are two functions involved here, and I am not sure which of the two you
> mean by 'nominated'. The first function is the one you would code as
> 'DefaultFigureCreateFcn'; that function I would have call uipushtool() in
> order to add a reference to the second function as a figure pushbutton .
>
> The second function involved is the one that would actually get invoked when
> the button is pushed, and it would invoke the window/leveler functionality.
> For example, instead of having to type imcontrast at the command window, the
> second function could invoke imcontrast on your behalf, done via a mouse movement.
>
> It might possibly be as simple as coding the uipushtool pushbutton callback as
> {@(src,event) imcontrast(src)}
>

Thanks, I'll look into this. It seems I was thinking the same thing but worded it rather poorly, since I haven't actually done it before (meaning changed default figure create fcns nor added pushbuttons to guis before)....

Fortunately, as TMW is generally quick about responding to suggestions for improvement, a technical support service request [THREAD ID: 1-CSP7JB] has already begun on this topic and I have pointed Manu Raghavan from TMW to this discussion, so that I don't have to repeat the ideas and what others have said on here. Hopefully, TMW can help get this squared away.

It may be simply a race between my frustration level and TMW's speed at solving the problem at this point, because I'll start to code if it takes too long. It's really upsetting that this feature isn't available, especially since imageJ has had it for a very long time (since 2002 at least) ref: http://rsbweb.nih.gov/ij/plugins/window-level.html. I have often wondered if I should just abandon Matlab for image processing since imageJ seems to be doing circles around Matlab's image processing toolbox.


> When I refer to working on "features already extract from images", what I mean
> is most of the projects I have worked on do not use raw medical images, but
> instead work on information that someone else (using some other tool) has
> extracted from images. When we do work with images it is commonly a time
> course, and we internally treat the data as multidimensional points with each
> pixel corresponding to one feature. Our tools are not sensitive to scaling and
> translation -- provided, of course, that reasonable precision is maintained.
> Our tools do have problems if you do the equivalent of setting the contrast to
> the maximum or minimum ;-)

Yes, well I would expect your tools not to be sensitive to scaling/translation of intensity but I am a bit surprised if you mean not sensitive to scaling/translation of geometry over a time course. Typically geometric insensitivity requires application of some sort of registration transform beforehand. Anyway, window/level functionality is more for easing eye-brain processing, not so much pixel feature computations.

Thanks for your input.