Cvb.Foundation.Scale

Good afternoon,

when scaling image data, I just realized that the function

Cvb.Foundation.Scale.To32BppFloat(MyImage.Planes[0].Map(), 0.0, 1.0);

raises an exception, whereas

Cvb.Foundation.Convert.To32BppFloat(MyImage.Planes[0].Map());

executes without any problem. The source MyImage.Planes[0].Map() is a 16 bit unsigned image.

I would have expected that both of them work. Is this a misconception on my side?

This is the exception:

System.NotSupportedException
  HResult=0x80131515
  Nachricht = 
  Quelle = Stemmer.Cvb
  StapelĂĽberwachung:
   at Stemmer.Cvb.Runtime.InteropServices.Processing.GenericInvocation(StandardProcessingFunctionImg fn, ReturnCodeTranslation returnCodeTranslator)
   at StreamDisplay.MainForm.OnProcessing() in D:\MainForm.cs:line 329
   at StreamDisplay.MainForm.OnNewImage() in D:\MainForm.Streaming.cs:line 156
   at StreamDisplay.MainForm.<.ctor>b__8_1(Object s, ImageEventArgs e) in D:\MainForm.cs:line 52
   at Stemmer.Cvb.Forms.Components.StreamHandler.<>c__DisplayClass15_0.<ContextSendMessage>b__0(Object _)

Innere Ausnahme 1:
CvbException:

Hi @MarSch,

I can indeed reproduce this… :unamused:
It seems like it only throws on 16bit source images.
I will investigate this problem and let you know as soon as I know more!

Hi,

I am sorry but the underlying ScaleTo32BPPFloat function only digests 8 bit unsigned input data.

Hi Volker,

do you consider to extend this to 16 to 64 bit unsigned types in future versions?

Thank you,

Markus

/mobile

Generally: Why not? However this will not be available short term…

1 Like