{"id":31737519,"url":"https://github.com/ucd4ids/polyharmonictrigtransforms.jl","last_synced_at":"2026-03-16T09:03:10.430Z","repository":{"id":271492261,"uuid":"878826556","full_name":"UCD4IDS/PolyHarmonicTrigTransforms.jl","owner":"UCD4IDS","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-03T01:04:30.000Z","size":133,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T02:29:36.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/UCD4IDS.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-26T08:02:33.000Z","updated_at":"2025-10-03T00:55:18.000Z","dependencies_parsed_at":"2025-01-08T05:20:00.199Z","dependency_job_id":"584a9646-c7fd-41cc-a0b0-d9c966514a79","html_url":"https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl","commit_stats":null,"previous_names":["ucd4ids/polyharmonictrigtransforms.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UCD4IDS/PolyHarmonicTrigTransforms.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UCD4IDS%2FPolyHarmonicTrigTransforms.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UCD4IDS%2FPolyHarmonicTrigTransforms.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UCD4IDS%2FPolyHarmonicTrigTransforms.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UCD4IDS%2FPolyHarmonicTrigTransforms.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UCD4IDS","download_url":"https://codeload.github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UCD4IDS%2FPolyHarmonicTrigTransforms.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001126,"owners_count":26083021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-09T09:22:52.173Z","updated_at":"2026-03-16T09:03:10.424Z","avatar_url":"https://github.com/UCD4IDS.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![CI](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/CI.yml) [![CompatHelper](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/CompatHelper.yml/badge.svg?branch=main)](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/CompatHelper.yml) [![TagBot](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/TagBot.yml/badge.svg?branch=main)](https://github.com/UCD4IDS/PolyHarmonicTrigTransforms.jl/actions/workflows/TagBot.yml)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Julia](#julia)\n- [LLST](#llst)\n- [PHLCT](#phlct)\n- [Troubleshooting](#troubleshooting)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n## Project\nThis project is from [Professor Saito's paper][paper], fully converted from Matlab to Julia. The implementation is almost identical with Matlab except \nsome minor feature differences or lack of features like matlab `meshgrid` is not in Julia so similar\nfeature is customly built. Similarly, matlab `repmat` is equivalent to Julia `repeat`.\n\n## Julia\n\nThis project is running in [Julia version 1.85][JuliaVersion] and fully tested in mac os and windows with version 1.8-1.86 and developed in VS Code with Julia [extension][JuliaExtension] version 1.47.2.\n\n\n```\n/\n  /data:                      image of barbara converted to data\n  /polyharmonictrigtransforms:  package toml\n  /src:                         julia source files\n  /tests:                       julia test files\n```\n\nThe above is the file structure. \n\nRead more about [Julia][JuliaDoc], [Julia Plot][JuliaPlot] and [Matlab][MatlabDoc].\n\n## PolyHarmonicTrigTransforms\n\n```\ninclude(\".PolyHarmonicTrigTransforms.jl\")\nusing .PolyHarmonicTrigTransforms\n\njulia\u003e dst\ndst (generic function with 2 methods)\n\njulia\u003e llst\nllst (generic function with 2 methods)\n\njulia\u003e solvelaplace\nsolvelaplace (generic function with 1 method)\n```\n\n\n## LLST\n\nThis Julia project focuses on LST (Local Sine Transformation) from [Professor Saito's paper][paper] \n\n**LLST - Laplace LST**\n\nTo test `llstapprox2`, it requires 3 inputs: data, leveled list, range.\n\nIn a high level, `llstapprox2.jl` calls `llst.jl` and calculates the coefficients into grids and\n`llstapprox2.jl` determines the boundaries/borders/corners/interior data to remove/process via `split_llst_coefs` and \nat the end of `llstapprox2.jl`, combines the boundaries/borders/corners/interior data into a grid through `merge_llst_coefs` then calculates the PSNR of the processed data and raw data.\n\nA sample test with 127x127 dataset:\n```\nn=127\nx = LinRange(-1,1,n) \ny = LinRange(-1,1,n) \nGaussian = zeros((length(x), length(y)))\n\nfor i in 1:n\n    for j in 1:n\n        t = exp(-(x[i] + 1/3)^2 - (y[j] + 1/3)^2)\n        Gaussian[i, j] = t\n    end\nend\n\n\n# test for J = 1\nlevlist1 = [1 1 1 1]\nkrange1 = [1:n^2;]\n\npsnr = llstapprox2(Gaussian, levlist1, krange1)\n```\n\nTo test LLST with the same data from the above:\n```\nllst_data = llst(Gaussian, levlist1)\n```\nReference: [Professor Saito's paper][paper] page 13 Figure 3(a).\n\n## PHLCT\nThe PHLCT (PolyHarmonic Local Cosine Transformation) from [Professor Saito's paper][paper] Chapter 6.2.2. (This PHLCT was compared with the version from Professor Katsu Yamatani: `phlct2d` and `iphct2d`)\n\n**PHLCT - PolyHarmonic LCT**\n\nTo test PHLCT, it requires 2 inputs: data and the size of block.\n\nIn a high level, PHLCT has 3 methods: `phlct_forward`, `phlct_backward`, and `phlct_restore`.\nThe `phlct_forward` is calculating the DCT coefficients of u = in - v where v denotes the PolyHarmonic function. \n\nThe `phlct_backward` reconstructs the data from DCT coefficients and PolyHarmonic function and returns the data close to the original data.\n\nTo run PHLCT, run `phlct_forward` then `phlct_backward` it should return the original input. \nFor Professor Yamatani's version, run `phlct2d` then `iphlct2d`.\n\nThe `phlct_restore` attempts to restore the data back to the original data from truncation by referencing the quantization table to each blocks.\n\nTo test PHLCT:\n```\nn = 8\nbfo128 = [...] #input data\nforward = phlct_forward(bfo128, n)\nbackward = phlct_backward(forward, n)\n\n#Professor Yamatani's version\nphlct = phlct2d(bfo128, n)\niphlct = iphlct2d(phlct, n)\n```\n\nReference: [Professor Saito's paper][paper] page 30 Chapter 6.2.2.\n\n#### Image Testing\n\nTo test images, first take your chosen image and convert it into a square image (i.e. size n x n where n is the new size of the image after using tools to square it).\n\nThen, use the above sample set of 5 x 5 dataset with the following changes:\n\n```\nn = 5\nx = LinRange(-1, 1, n)\ny = LinRange(-1, 1, n)\nGaussian = zeros((length(x), length(y)))\n\t\t\nfunction GaussianFromImage(image_path)\n    img = load(image_path)\n    width, height = size(img)\n    Gaussian = zeros(Float64, (width, height))\n\t\n    for i in 1:width\n        for j in 1:height\n          pixel_value = Gray(img[i, j])\n          t = exp(-((1 - i/3)^2 + (1 - j/3)^2))\n          Gaussian[i, j] = t\n        end\n    end\n    return Gaussian\nend\n\t\nimage_path = \"(insert your image path)\"\nGaussian = GaussianFromImage(image_path)\nimg = load(image_path)\nwidth, height = size(img)\n```\n## Helper\n\nThe function `drawpartition2d2` is used to draw the boundaries. It takes 5 parameters: `signal::AbstractMatrix, liste::AbstractMatrix; width=nothing, image=nothing,  fit=false`.\nRequired:\n- `signal` is the data matrix\n- `liste` is the level list\nOptional:\n- `width` is the width of the plot line, defaults to `0.8`\n- `image` is the path of the background image\n- `fit` is the `boolean` to fit the image to the plot \n\n```\nn = 5\nx = LinRange(-1, 1, n)\ny = LinRange(-1, 1, n)\nGaussian = zeros((length(x), length(y)))\ndrawpartition2d2(Gaussian, [1 1 1], image=\"test.jpg\", fit=true)\n```\n\n## Troubleshooting\n\n1. Package is missing. \n\nTo install a package:\n\nIn Julia CLI:\n```\njulia\u003e import Pkg; Pkg.add(\"MAT\")\n```\nor\nIn a Package Manager `]`\n```\njulia\u003e ]\n\n(@v1.8) pkg\u003e add \"MAT\"\n```\n\nExample plain HTML site using GitLab Pages.\n\nLearn more about GitLab Pages at https://pages.gitlab.io and the official\ndocumentation https://docs.gitlab.com/ce/user/project/pages/.\n\n---\n\n\n\n[paper]: https://www.math.ucdavis.edu/~saito/publications/saito_phlstrev.pdf\n[JuliaVersion]: https://julialang.org/downloads/\n[JuliaDoc]: https://docs.julialang.org/en/v1/\n[JuliaExtension]: https://marketplace.visualstudio.com/items?itemName=julialang.language-julia\n[MatlabDoc]: https://www.mathworks.com/help/matlab/\n[JuliaPlot]: https://docs.juliaplots.org/stable/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucd4ids%2Fpolyharmonictrigtransforms.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucd4ids%2Fpolyharmonictrigtransforms.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucd4ids%2Fpolyharmonictrigtransforms.jl/lists"}