-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for calculating structure tensor #34
Open
calvinchai
wants to merge
6
commits into
lincbrain:main
Choose a base branch
from
calvinchai:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c68e988
Add docs for calculating structure tensor
calvinchai ddea506
Merge branch 'lincbrain:main' into main
calvinchai 2736b0d
Update mkdocs.yml
calvinchai 6f9de0c
Update docs/structure-tensor.md
calvinchai 9eaac07
Update docs/structure-tensor.md
calvinchai 197461d
Update Structure Tensor docs
calvinchai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Calculate Structure Tensors | ||
|
||
## Prerequisites | ||
|
||
Ensure the [repository](https://github.com/Tinggong/structens) is cloned and its dependencies are installed. | ||
|
||
## Steps to Calculate Structure Tensor | ||
|
||
1. Run Structure Tensor Calculation | ||
|
||
Use the process_zarr function to compute the structure tensor from your input Zarr file. Adjust sigma and rho to control the smoothing parameters: | ||
``` | ||
input = "/scratch/input.zarr" | ||
output = "/scratch/output.zarr" | ||
process_zarr(input, output, sigma=0, rho=5) | ||
• sigma: Controls the Gaussian smoothing applied before computing derivatives. | ||
• rho: Controls the Gaussian smoothing applied after computing the tensor. | ||
``` | ||
2. Generate Pyramid for Multi-Resolution Data | ||
|
||
To enable visualization or efficient access, create a resolution pyramid with generate_pyramid: | ||
``` | ||
generate_pyramid(Zarr.zopen(output, "w"), levels=6, mode="mean") | ||
|
||
• levels: Specifies the number of pyramid levels. | ||
• mode: Determines the aggregation method (e.g., mean). | ||
``` | ||
3. Add OME Metadata | ||
|
||
To make the output Zarr file compatible with tools like Neuroglancer, write OME-compliant metadata: | ||
|
||
``` | ||
write_ome_metadata(Zarr.zopen(output, "w"), ["c", "z", "y", "x"]) | ||
|
||
```` | ||
Example Workflow | ||
1. Input: /scratch/input.zarr | ||
2. Output: /scratch/output.zarr | ||
``` | ||
process_zarr("/scratch/input.zarr", "/scratch/output.zarr", sigma=0, rho=5) | ||
generate_pyramid(Zarr.zopen("/scratch/output.zarr", "w"), levels=6, mode="mean") | ||
write_ome_metadata(Zarr.zopen("/scratch/output.zarr", "w"), ["c", "z", "y", "x"]) | ||
``` | ||
This pipeline will produce a multi-resolution Zarr dataset ready for visualization and further analysis. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is a private repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirming that this is intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me ask Ting. We can probably make this public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have a public repository under lincbrain and we still need some work to test and document the code before making it public. So it's okay to remove the link to the repository for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Ting's suggestion that creates another repo under lincbrain. As this is currently internal, we could probably have the link to the current repo and change it once we move a staged version to lincbrain. How does this sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good, thanks.