public static NativePixelData ToNativePixelData(this DicomPixelData dicomPixelData)
 {
     return new NativePixelData
                {
                    NumberOfFrames = dicomPixelData.NumberOfFrames,
                    Width = dicomPixelData.Width,
                    Height = dicomPixelData.Height,
                    SamplesPerPixel = dicomPixelData.SamplesPerPixel,
                    HighBit = dicomPixelData.HighBit,
                    BitsStored = dicomPixelData.BitsStored,
                    BitsAllocated = dicomPixelData.BitsAllocated,
                    BytesAllocated = dicomPixelData.BytesAllocated,
                    UncompressedFrameSize = dicomPixelData.UncompressedFrameSize,
                    PlanarConfiguration = (int)dicomPixelData.PlanarConfiguration,
                    PixelRepresentation = (int)dicomPixelData.PixelRepresentation,
                    TransferSyntaxIsLossy = dicomPixelData.Syntax.IsLossy,
                    PhotometricInterpretation = dicomPixelData.PhotometricInterpretation.Value,
                    GetFrameImpl = index => dicomPixelData.GetFrame(index).Data,
                    AddFrameImpl = buffer => dicomPixelData.AddFrame(new MemoryByteBuffer(buffer)),
                    SetPlanarConfigurationImpl =
                        value => dicomPixelData.PlanarConfiguration = (PlanarConfiguration)value,
                    SetPhotometricInterpretationImpl =
                        value =>
                        dicomPixelData.PhotometricInterpretation =
                        PhotometricInterpretation.Parse(value)
                };
 }
Exemplo n.º 2
0
 // ------------------------------------------------------------------
 /// \param _animClip the sprite animatoin clip
 /// \param _objects the texture objects
 /// add textures to sprite animation clip as new frames
 // ------------------------------------------------------------------
 public static void AddFrames( this exSpriteAnimClip _animClip, Object[] _objects )
 {
     foreach ( Object o in _objects ) {
         if ( o is Texture2D ) {
             Texture2D t = o as Texture2D;
             _animClip.AddFrame(t); // NOTE: it will SetDirty here
         }
     }
 }
Exemplo n.º 3
0
 public static CheckBox AddCheckBox(this Control parent, string syle = "checkBox", int width = 14, int height = 14)
 {
     var checkBox = new CheckBox();
     checkBox.Parent = parent.AddFrame(0, 0, DockStyle.Fill);
     checkBox.Size = new Point(width, height);
     checkBox.Dock = DockStyle.Center;
     checkBox.Style = syle;
     return checkBox;
 }
 public static FrameBuilder AddFrameWithDefaults(this FrameBuilder builder, int frameLength = 1000)
 {
     return builder
     .AddFrame()
     .WithFrameLength(frameLength)
     .WithRepeated(true)
     .WithLightSection(lightSection)
     .WithFanSection(fanSection)
     .WithRumbleSection(rumbleSection);
 }
Exemplo n.º 5
0
        public static DropDownList AddStringList(this Control parent, int width, string text, List<string> strings)
        {
            var frame = parent.AddFrame(0, 20, DockStyle.Top);
            frame.AddLabel(width, text);
            frame.Margin = new Margin(10, 0, 0, 0);
            var list = frame.AddDropDownList();

            foreach (var s in strings)
            {
                list.Items.Add(new ListBoxItem() { Text = s, Style = "comboItemNoImage" });
            }

            list.TabIndex = tabStopIndex++;
            return list;
        }
Exemplo n.º 6
0
 public static TextBox AddLabeledTextBox(this Control parent, int width, string text, float scale = 1.0f)
 {
     var frame = parent.AddFrame(0, 20, DockStyle.Top);
     frame.AddLabel(width, text);
     frame.Margin = new Margin(10, 0, 0, 0);
     var textBox = frame.AddTextBox();
     textBox.TabIndex = tabStopIndex++;
     textBox.Scale = scale;
     return textBox;
 }
Exemplo n.º 7
0
        public static TextBox AddLabeledFilename(this Control parent, int width, string text, string defaultExt, string filter, string title)
        {
            var frame = parent.AddFrame(0, 20, DockStyle.Top);
            frame.AddLabel(width, text);
            frame.Margin = new Margin(10, 0, 0, 0);

            var button = frame.AddButton("button", 20, 20, DockStyle.Right);
            button.Text = "...";

            var textBox = frame.AddTextBox();
            textBox.TabIndex = tabStopIndex++;

            button.MouseClick += (s, e) =>
            {
                var dialog = new System.Windows.Forms.OpenFileDialog();
                if (textBox.Text.Length > 0)
                {
                    dialog.FileName = textBox.Text;
                }
                dialog.DefaultExt = defaultExt;
                dialog.Filter = filter;
                dialog.Title = title;
                dialog.Multiselect = false;
                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    textBox.Text = dialog.FileName;
                }
            };

            return textBox;
        }
Exemplo n.º 8
0
 public static ColorButton AddLabeledColorButton(this Control parent, int width, string text)
 {
     var frame = parent.AddFrame(0, 20, DockStyle.Top);
     frame.AddLabel(width, text);
     frame.Margin = new Margin(10, 0, 0, 0);
     var button = frame.AddColorButton(20, 20, DockStyle.Fill);
     button.TabIndex = tabStopIndex++;
     return button;
 }
Exemplo n.º 9
0
 public static CheckBox AddLabeledCheckBox(this Control parent, int width, string text)
 {
     var frame = parent.AddFrame(0, 20, DockStyle.Top);
     frame.AddLabel(width, text);
     frame.Margin = new Margin(10, 0, 0, 0);
     var checkBox = frame.AddCheckBox();
     checkBox.TabIndex = tabStopIndex++;
     return checkBox;
 }
Exemplo n.º 10
0
        public static DropDownList AddEnumList(this Control parent, int width, string text, Type enumType)
        {
            var frame = parent.AddFrame(0, 20, DockStyle.Top);
            frame.AddLabel(width, text);
            frame.Margin = new Margin(10, 0, 0, 0);
            var list = frame.AddDropDownList();

            var values = Enum.GetValues(enumType);
            foreach (var value in values)
            {
                list.Items.Add(new ListBoxItem() { Text = value.ToString(), Style = "comboItemNoImage" });
            }

            list.TabIndex = tabStopIndex++;
            return list;
        }
Exemplo n.º 11
0
 public static void AddMany(this Bowling bowling,Frame frame, int index)
 {
     for (int i = 0; i < index;i++ )
         bowling.AddFrame(frame);
 }