Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.