Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A python package for DICOM to NifTi and NifTi to DICOM-SEG and GSPS conversion
The python package is available for use on PyPI. It can be setup simply via pip
pip install nekton
To the check the setup, simply check the version number of the nekton
package by
python -c 'import nekton; print(nekton.__version__)'
The DICOM to NifTi conversion in the package is based on a wrapper around the dcm2niix software.
from nekton.dcm2nii import Dcm2Nii
converter = Dcm2Nii()
converted_files = converter.run(dicom_directory='/test_files/CT5N', out_directory='/test_files/CT5N', name='Test')
# Converted 5 DCM to Nifti; Output stored @ /test_files/CT5N
print(converted_files)
# ['/test_files/CT5N/Test_SmartScore_-_Gated_0.5_sec_20010101000000_5.nii.gz']
Parameters converter.run
:
dicom_directory (Path)
: path to directory with Dicomsdicom_directory (Path, optional)
: directory to store the output niftiname (str, optional)
: Name to be given to the output file. Defaults to "".Returns:
List[Path]
: output list of Nifti filesThe NifTi to DICOM-SEG within nekton converts incoming segmentation NifTi to DICOM-SEG. The matching of the segmentation index to a text label is
done via json file using the schema suggested by dcmqi
. The json can be generated using the gui also an example can be seen here.
Currently, nekton
supports creation of multiclass DICOM-SEG of two types-
from nekton.nii2dcm import Nii2DcmSeg
import glob
converter = Nii2DcmSeg()
path_dcms = [path for path in glob.glob(dir_dcms)]
path_mapping = "mapping.json"
path_seg_nifti = "CT5N_segmentation.nii.gz"
dcmsegs = converter_dcmseg.multiclass_converter(
segfile = path_seg_nifti, segMapping= path_mapping, dcmfiles =path_dcms, multiLayer=False
)
print (len(dcmsegs))
# 3
from nekton.nii2dcm import Nii2DcmSeg
import glob
converter = Nii2DcmSeg()
path_dcms = [path for path in glob.glob(dir_dcms)]
path_mapping = "mapping.json"
path_seg_nifti = "CT5N_segmentation.nii.gz"
dcmsegs = converter.multiclass_converter(
segfile = path_seg_nifti, segMapping= path_mapping, dcmfiles =path_dcms, multiLayer=True
)
print (len(dcmsegs))
# 1
Parameters converter.multiclass_converter
:
segfile (Path)
: path to the nifti segmentation filesegMapping (Path)
: path to the dcmqii format segmentation mapping jsondcmfiles (List[Path])
: list of paths of all the source dicom filesmultiLayer (bool, optional)
: create a single multilayer dicomseg. Defaults to False.Returns:
List[Path]
: list of paths of all generated dicomseg filesThis feature will be available in a future release of the nekton
FAQs
A python package for DICOM to NifTi and NifTi to DICOM-SEG and GSPS conversion
We found that nekton demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.