Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
github.com/ryanchen01/imagetk
ImageTK is a Go library for handling and manipulating multi-dimensional images with support for various pixel types and image formats.
go get github.com/ryanchen01/imagetk
// Create a 2D image with float32 pixels
size := []uint32{10, 10}
img, err := NewImage(size, PixelTypeFloat32)
if err != nil {
log.Fatal(err)
}
// Set a pixel value
err = img.SetPixel([]uint32{0, 0}, float32(1.0))
if err != nil {
log.Fatal(err)
}
// Get a pixel value
value, err := img.GetPixel([]uint32{0, 0})
if err != nil {
log.Fatal(err)
}
interpolator := LinearInterpolator{
Size: []uint32{20, 20},
Spacing: []float64{0.5, 0.5},
Origin: []float64{0.0, 0.0},
Direction: [9]float64{1, 0, 0, 0, 1, 0, 0, 0, 1},
}
resampledImg, err := img.Resample(interpolator)
if err != nil {
log.Fatal(err)
}
// Read an MHD image
img, err := ReadImage("image.mhd", ImageTypeMHD, nil)
if err != nil {
log.Fatal(err)
}
// Write an MHD image
err = WriteImage(img, "output.mhd", ImageTypeMHD)
if err != nil {
log.Fatal(err)
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
The implementation includes code for:
image.go
)io.go
)interpolate.go
)stats.go
)point.go
)For detailed implementation examples, please refer to the test files in the repository.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.