{"id":28486479,"url":"https://github.com/juanprietob/itk-image-pad-resample","last_synced_at":"2026-05-08T13:18:19.533Z","repository":{"id":36915655,"uuid":"230852459","full_name":"juanprietob/itk-image-pad-resample","owner":"juanprietob","description":"Resample any image 2D, 3D, with 1 or multiple components and a wide variety of formats NIFTI, NRRD, DICOM","archived":false,"fork":false,"pushed_at":"2022-03-25T23:31:45.000Z","size":3235,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T08:43:00.077Z","etag":null,"topics":["emscripten","image","itk","javascript","medical-imaging","nodejs","resample"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juanprietob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-30T05:19:26.000Z","updated_at":"2022-03-07T08:10:36.000Z","dependencies_parsed_at":"2022-08-08T18:16:45.391Z","dependency_job_id":null,"html_url":"https://github.com/juanprietob/itk-image-pad-resample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/juanprietob/itk-image-pad-resample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanprietob%2Fitk-image-pad-resample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanprietob%2Fitk-image-pad-resample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanprietob%2Fitk-image-pad-resample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanprietob%2Fitk-image-pad-resample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanprietob","download_url":"https://codeload.github.com/juanprietob/itk-image-pad-resample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanprietob%2Fitk-image-pad-resample/sbom","scorecard":{"id":540665,"data":{"date":"2025-08-11","repo":{"name":"github.com/juanprietob/itk-image-pad-resample","commit":"925b156cba44e4733c06a9d4cb636bb10f5470e6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":0,"reason":"23 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-22h7-7wwg-qmgg","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T08:07:52.448Z","repository_id":36915655,"created_at":"2025-08-20T08:07:52.448Z","updated_at":"2025-08-20T08:07:52.448Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32781992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emscripten","image","itk","javascript","medical-imaging","nodejs","resample"],"created_at":"2025-06-08T01:35:03.127Z","updated_at":"2026-05-08T13:18:19.527Z","avatar_url":"https://github.com/juanprietob.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# itk-image-pad-resample\n\n\u003e Resample virtually any type of image 2D, 3D with 1 or multiple components.\n\n[![NPM](https://img.shields.io/npm/v/itk-image-pad-resample.svg)](https://www.npmjs.com/package/itk-image-pad-resample) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Install\n\nInstall with the flag '-g' and use it in the command line. \n\n```bash\nnpm install itk-image-pad-resample -g\n```\n\n## Usage in the command line\n\n```bash\nimg-pad-resample --help\n```\n\n```\nHelp: Resample an image to a specific size.\nRequired:\n--img \u003cinput path to image\u003e or --dir \u003cdirectory\u003e\n--size \u003csizeX,sizeY,sizeZ\u003e\n\nOptional:\n--out \u003coutput path\u003e default: out.nrrd\n--out_ext \u003coutput extension\u003e (when using --dir) default: .nrrd\n--spacing \u003cspacingX,spacingY,spacingZ\u003e Input image spacing is used. Otherwise, is set to fit the output size.\n--pad \u003cpadX,padY,padZ\u003e pad output at the top\n--iso_spacing If this is set, the spacing of the output image will be isometric, i.e., the same for all dimensions which means the max spacing value is selected and set for all dimensions.\n--center_image If this is set, the output image is centered in the resampled space.\n--linear Linear interpolation, default is nearest neighbor.\n```\n\n```bash\nimg-pad-resample --img /path/to/input.nii --size 250,250,250 --out temp.nrrd \n```\n\nTo process a whole directory with images\n\n```bash\nimg-pad-resample --dir /path/to/directory --size 250,250 --out /path/to/output/dir --out_ext .jpg\n```\n\n## Usage in your js logic\n\nUse [med-img-reader](https://www.npmjs.com/package/med-img-reader) to read any type of image with one or multiple\ncomponents in a variety of formats. \n\n```js\nconst MedImgReader = require('med-img-reader');\nconst ImgPadResampleLib = require('itk-image-pad-resample');\n```\n\n```js\nconst medimgreader = new MedImgReader();\nmedimgreader.SetFilename('/path/to/input{.png,.jpg,.nrrd,.nii.gz,.dcm}');\nmedimgreader.ReadImage();\nconst in_img = medimgreader.GetOutput();\n\nconst imgpad = new ImgPadResampleLib();\nimgpad.SetImage(in_img);\nimgpad.SetOutputSize([300, 250]);\nimgpad.SetFitSpacingToOutputSizeOn(); //optional\nimgpad.SetIsoSpacingOn(); //optional \nimgpad.SetCenterImageOn(); //optional\nimgpad.SetInterpolationTypeToLinear(); //default is nearest\nimgpad.Update();\nvar img_out = imgpad.GetOutput();\n\nconst writer = new MedImgReader();\nwriter.SetInput(img_out);\nwriter.SetFilename('/path/to/ouput/{.png,.jpg,.nrrd,.nii.gz,.dcm}');\nwriter.WriteImage();\n\n```\n\n## Example\n\nInput RGBA image: \n![alt text](https://github.com/juanprietob/itk-image-pad-resample/raw/master/test/brain.png \"Brain image with multiple components (RGB)\")\n\n```bash\nimg-pad-resample --img brain.png --size 500,250 --out out_brain.png \n```\n\nOutput RGBA image, the image here might look stretched because typical image viewers will not take spacing information in consideration!: \n![alt text](https://github.com/juanprietob/itk-image-pad-resample/raw/master/test/out_brain.png \"Image with different spacing\")\n\n\nUse flag '--iso_spacing' to have the same spacing in all dimensions\n```bash\nimg-pad-resample --img brain.png --size 500,250 --iso_spacing --out out_brain_iso.png \n```\n\nOutput RGBA image with equal spacing: \n![alt text](https://github.com/juanprietob/itk-image-pad-resample/raw/master/test/out_brain_iso.png \"Image with equal spacing\")\n\n## Convert image to a tensorflow Tensor [tfjs](https://www.tensorflow.org/js)\n\n---\n\tconst tf = require('@tensorflow/tfjs-node');//Or tfjs in browser or tfjs-node-gpu if in linux\n\n\ttf.tensor(\n\t\tFloat32Array.from(img_out.data), \n\t\t[1, ...[...img_out.size].reverse(), img_out.imageType.components]\n\t));\n---\n\n## License\n\nMIT © [juanprietob](https://github.com/juanprietob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanprietob%2Fitk-image-pad-resample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanprietob%2Fitk-image-pad-resample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanprietob%2Fitk-image-pad-resample/lists"}