array mask not being reset in application
In the attached app, there are 2 sliders for "set range low" and "set range high" which are used to change the scale of hte colorbar. The goal of doing this artifcats in the image.
Anything outside of the range of the colorbar is highlighted with the imdilate function in the mask which is then displayed as a replacement to the orignal image
When we click the buttons for "set range low" and "set range high", it should change the values of the image array so that anything outisde of the high and low limits is set to the actual high or low limit itself.
This seems to work, the problem is that the mask does not seem to reset. So after you click the buttons to "set the range low" in the image, if you go back to the slider and go outside of hte orignal range, there are still values that show up.
Im not sure what is going on, it seems to work ok in the matlab but not the application designer. Been stuck on this for an embarassing amount of time and could use a hand. thank you.
maxvalue = app.Sliderhigh.Value;
minvalue = app.Sliderlow.Value;
app.highEditField.Value = num2str(maxvalue);
app.lowEditField.Value= num2str(minvalue);
c = colorbar(app.UIAxes);
app.UIAxes.CLim = [minvalue maxvalue];
maska= app.a >maxvalue | app.a <minvalue ;
maskc = imdilate(maska,strel(‘disk’,25,0));
imagesc(maxvalue*maskc,’Parent’,app.UIAxes)In the attached app, there are 2 sliders for "set range low" and "set range high" which are used to change the scale of hte colorbar. The goal of doing this artifcats in the image.
Anything outside of the range of the colorbar is highlighted with the imdilate function in the mask which is then displayed as a replacement to the orignal image
When we click the buttons for "set range low" and "set range high", it should change the values of the image array so that anything outisde of the high and low limits is set to the actual high or low limit itself.
This seems to work, the problem is that the mask does not seem to reset. So after you click the buttons to "set the range low" in the image, if you go back to the slider and go outside of hte orignal range, there are still values that show up.
Im not sure what is going on, it seems to work ok in the matlab but not the application designer. Been stuck on this for an embarassing amount of time and could use a hand. thank you.
maxvalue = app.Sliderhigh.Value;
minvalue = app.Sliderlow.Value;
app.highEditField.Value = num2str(maxvalue);
app.lowEditField.Value= num2str(minvalue);
c = colorbar(app.UIAxes);
app.UIAxes.CLim = [minvalue maxvalue];
maska= app.a >maxvalue | app.a <minvalue ;
maskc = imdilate(maska,strel(‘disk’,25,0));
imagesc(maxvalue*maskc,’Parent’,app.UIAxes) In the attached app, there are 2 sliders for "set range low" and "set range high" which are used to change the scale of hte colorbar. The goal of doing this artifcats in the image.
Anything outside of the range of the colorbar is highlighted with the imdilate function in the mask which is then displayed as a replacement to the orignal image
When we click the buttons for "set range low" and "set range high", it should change the values of the image array so that anything outisde of the high and low limits is set to the actual high or low limit itself.
This seems to work, the problem is that the mask does not seem to reset. So after you click the buttons to "set the range low" in the image, if you go back to the slider and go outside of hte orignal range, there are still values that show up.
Im not sure what is going on, it seems to work ok in the matlab but not the application designer. Been stuck on this for an embarassing amount of time and could use a hand. thank you.
maxvalue = app.Sliderhigh.Value;
minvalue = app.Sliderlow.Value;
app.highEditField.Value = num2str(maxvalue);
app.lowEditField.Value= num2str(minvalue);
c = colorbar(app.UIAxes);
app.UIAxes.CLim = [minvalue maxvalue];
maska= app.a >maxvalue | app.a <minvalue ;
maskc = imdilate(maska,strel(‘disk’,25,0));
imagesc(maxvalue*maskc,’Parent’,app.UIAxes) application designer, mask MATLAB Answers — New Questions