diff --git a/automatic/imagej/README.md b/automatic/imagej/README.md new file mode 100644 index 000000000..c1efeb19b --- /dev/null +++ b/automatic/imagej/README.md @@ -0,0 +1,54 @@ +# [ImageJ - Image Processing and Analysis in Java](https://chocolatey.org/packages/imagej) + +[![Software license](https://img.shields.io/badge/License-Public%20Domain-brightgreen.svg)](https://imagej.nih.gov/ij/disclaimer.html) +[![Maintenance status](https://img.shields.io/badge/maintained%3F-yes-green.svg)](https://gitHub.com/dgalbraith/chocolatey-packages/graphs/commit-activity) +[![AppVeyor build](https://img.shields.io/appveyor/ci/dgalbraith/chocolatey-packages)](https://ci.appveyor.com/project/dgalbraith/chocolatey-packages) +[![Software version](https://img.shields.io/badge/Source-v1.52-blue)](http://wsr.imagej.net/distros/win/ij152-win-java8.zip) +[![Chocolatey package version](https://img.shields.io/chocolatey/v/imagej?label=Chocolatey)](https://chocolatey.org/packages/imagej) + +Public domain software for processing and analyzing scientific images – a.k.a. ImageJ 1.x. + +## Features + +* Display, edit, analyze, process, save, and print 8-bit color and grayscale, 16-bit integer, and 32-bit +floating point images + +* Read many image file formats, including TIFF, PNG, GIF, JPEG, BMP, DICOM, and FITS, as well as raw formats + +* Supports image stacks, a series of images that share a single window, and it is multithreaded, so +time-consuming operations can be performed in parallel on multi-CPU hardware + +* Calculate area and pixel value statistics of user-defined selections and intensity-thresholded objects + +* Measure distances and angles + +* Create density histograms and line profile plots + +* Supports standard image processing functions such as logical and arithmetical operations between images, +contrast manipulation, convolution, Fourier analysis, sharpening, smoothing, edge detection, and median +filtering + +* Geometric transformations such as scaling, rotation, and flips + +* Supports any number of images simultaneously, limited only by available memory + +![screenshot](https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@3d96ff972ea781c5e7ddf915b56f74c7b4baf5a4/automatic/imagej/screenshot.png) + +## Package Parameters + +The following package parameter can be set: + +* `/AddToDesktop` - add a desktop shortcut for ImageJ. By default the shortcut will be added for all users +* `/AddToStartMenu` - add a start menu entry for ImageJ. By default the shortcut will be added for all users + +eg. `choco install -y imagej --package-parameters="/AddToDesktop /AddToStartMenu"` + +* `/User` - where the user parameter is specified any shortcuts created (`/AddToDesktop`, `/AddToStartMenu`) +will only be added for the current user + +eg. `choco install -y imagej --package-parameters="/AddToDesktop /AddToStartMenu /User"` + +## Notes + +* This package is automatically updated using the [Chocolatey Automatic Package Update Model (AU)](https://github.com/majkinetor/au/blob/master/README.md). +If you find it is out of date by more than a day or two, please contact the maintainer(s) and let them know the package is no longer updating correctly. diff --git a/automatic/imagej/imagej.nuspec b/automatic/imagej/imagej.nuspec new file mode 100644 index 000000000..4730aa0ff --- /dev/null +++ b/automatic/imagej/imagej.nuspec @@ -0,0 +1,80 @@ + + + + + imagej + 1.52 + https://github.com/dgalbraith/chocolatey-packages/tree/master/automatic/imagej + dgalbraith + ImageJ - Image Processing and Analysis in Java + Wayne Rasband + https://imagej.nih.gov/ij + https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@a306a1daa4f210fa0a5421f2a3c996804629256a/icons/imagej.png + ImageJ is dedicated to the public domain + https://imagej.nih.gov/ij/disclaimer.html + false + https://github.com/imagej/ImageJ + https://imagej.nih.gov/ij/docs/index.html + https://imagej.nih.gov/ij/list.html + https://github.com/imagej/ImageJ/issues + imagej computer-vision image-analysis image-processing + Image processing and analysis in Java + + + https://imagej.nih.gov/ij/notes.html + + + + + + + diff --git a/automatic/imagej/legal/LICENSE.txt b/automatic/imagej/legal/LICENSE.txt new file mode 100644 index 000000000..5c4f96eb8 --- /dev/null +++ b/automatic/imagej/legal/LICENSE.txt @@ -0,0 +1,9 @@ +ImageJ Disclaimer + +ImageJ was developed at the National Institutes of Health by an employee of the +Federal Government in the course of his official duties. Pursuant to Title 17, +Section 105 of the United States Code, this software is not subject to +copyright protection and is in the public domain. ImageJ is an experimental +system. NIH assumes no responsibility whatsoever for its use by other parties, +and makes no guarantees, expressed or implied, about its quality, reliability, +or any other characteristic. diff --git a/automatic/imagej/legal/VERIFICATION.txt b/automatic/imagej/legal/VERIFICATION.txt new file mode 100644 index 000000000..c8de3d729 --- /dev/null +++ b/automatic/imagej/legal/VERIFICATION.txt @@ -0,0 +1,28 @@ +VERIFICATION + +Verification is intended to assist the Chocolatey moderators and community +in verifying that this package's contents are trustworthy. + +The application has been downloaded from the official distribution and can +be verified by: + +1. Go to the binary distribution page + + http://wsr.imagej.net/distros/win/ + +and download the installer ij152-win-java8.zip using the relevant links in the +asset section of the distribution page. + +Alternatively the distribution can be downloaded directly from + + http://wsr.imagej.net/distros/win/ij152-win-java8.zip + +2. The archive can be validated by comparing checksums + - Use powershell function 'Get-Filehash' - Get-Filehash ij152-win-java8.zip + - Use chocolatey utility 'checksum.exe' - checksum -t sha256 -f ij152-win-java8.zip + + File: ij152-win-java8.zip + ChecksumType: sha256 + Checksum: ACE9FAEDCB0BCCD9EE821A956CE52CAB295F781E70D7F62F0F6807EA98999ED9 + + Contents of file LICENSE.txt is obtained from https://imagej.nih.gov/ij/disclaimer.html diff --git a/automatic/imagej/tools/chocolateyBeforeModify.ps1 b/automatic/imagej/tools/chocolateyBeforeModify.ps1 new file mode 100644 index 000000000..b389460a7 --- /dev/null +++ b/automatic/imagej/tools/chocolateyBeforeModify.ps1 @@ -0,0 +1,20 @@ +$ErrorActionPreference = 'Stop' + +$link = 'imagej.lnk' +$desktop = [Environment]::GetFolderPath('Desktop') +$commonDesktop = [Environment]::GetFolderPath('CommonDesktopDirectory') +$startMenu = [Environment]::GetFolderPath('StartMenu') +$commonStartMenu = [Environment]::GetFolderPath('CommonStartMenu') + +$paths = @( + (Join-Path $desktop $link), + (Join-Path $commonDesktop $link), + (Join-Path $startMenu $link), + (Join-Path $commonStartMenu $link) +) + +$paths.GetEnumerator() | ForEach-Object { + if (Test-Path -Path $_) { + Remove-Item $_ -ErrorAction SilentlyContinue -Force | Out-Null + } +} diff --git a/automatic/imagej/tools/chocolateyInstall.ps1 b/automatic/imagej/tools/chocolateyInstall.ps1 new file mode 100644 index 000000000..59a597666 --- /dev/null +++ b/automatic/imagej/tools/chocolateyInstall.ps1 @@ -0,0 +1,47 @@ +$ErrorActionPreference = 'Stop' + +$toolsDir = (Split-Path -parent $MyInvocation.MyCommand.Definition) +$archive = Join-Path $toolsDir 'ij152-win-java8.zip' +$installDir = Get-ToolsLocation + +$packageArgs = @{ + PackageName = $env:ChocolateyPackageName + FileFullPath = $archive + Destination = $installDir +} + +Get-ChocolateyUnzip @packageArgs + +$executable = Get-ChildItem $installDir -include ImageJ.exe -recurse + +$pp = Get-PackageParameters + +if ($pp.AddToDesktop) { + if ($pp.User) { + $desktopPath = [Environment]::GetFolderPath('Desktop') + } else { + $desktopPath = [Environment]::GetFolderPath('CommonDesktopDirectory') + } + + $shortcutPath = Join-Path $desktopPath 'imagej.lnk' + + Install-ChocolateyShortcut -ShortcutFilePath $shortcutPath -TargetPath $executable + + Write-Host("Added {0} desktop shortcut pointed at {1}" -f $shortcutPath, $executable) +} + +if ($pp.AddToStartMenu) { + if ($pp.User) { + $startMenuPath = [Environment]::GetFolderPath('StartMenu') + } else { + $startMenuPath = [Environment]::GetFolderPath('CommonStartMenu') + } + + $shortcutPath = Join-Path $startMenuPath 'imagej.lnk' + + Install-ChocolateyShortcut -ShortcutFilePath $shortcutPath -TargetPath $executable + + Write-Host("Added {0} start menu entry pointed at {1}" -f $shortcutPath, $executable) +} + +Install-Binfile -Name 'imagej' -Path $executable -UseStart diff --git a/automatic/imagej/tools/chocolateyUninstall.ps1 b/automatic/imagej/tools/chocolateyUninstall.ps1 new file mode 100644 index 000000000..df6be9d9b --- /dev/null +++ b/automatic/imagej/tools/chocolateyUninstall.ps1 @@ -0,0 +1,5 @@ +$ErrorActionPreference = 'Stop' + +Uninstall-Binfile -name 'imagej' -path 'imagej.exe' + +Uninstall-ChocolateyZipPackage 'imagej' 'ij152-win-java8.zip' diff --git a/automatic/imagej/update.ps1 b/automatic/imagej/update.ps1 new file mode 100644 index 000000000..f8a079b75 --- /dev/null +++ b/automatic/imagej/update.ps1 @@ -0,0 +1,54 @@ +import-module au + +$ErrorActionPreference = 'Stop' + +$releases = "https://imagej.nih.gov/ij/download.html" + +$reArchive = "(?<=\/|\s|')(?(ij.+win.+zip))" +$reChecksum = '(?<=Checksum:\s*)((?([^\s].+)))' +$reRawVersion = '(?(?<=ij)(?[\d]{1})(?[\d]{2}))' +$reVersion = '(?<=v)(?([\d]{1}\.[\d]{2}\.?[\d]*))' + + +function global:au_BeforeUpdate { + Get-RemoteFiles -Purge -NoSuffix +} + +function global:au_SearchReplace { + @{ + ".\README.md" = @{ + "$($reVersion)" = "$($Latest.Version)" + } + + ".\legal\VERIFICATION.txt" = @{ + "$($reArchive)" = "$($Latest.FileName64)" + "$($reChecksum)" = "$($Latest.Checksum64)" + } + + ".\tools\chocolateyInstall.ps1" = @{ + "$($reArchive)" = "$($Latest.FileName64)" + } + + ".\tools\chocolateyUninstall.ps1" = @{ + "$($reArchive)" = "$($Latest.FileName64)" + } + } +} + +function global:au_GetLatest { + $downloadPage = Invoke-WebRequest -UseBasicParsing -Uri $releases + + $url64 = $downloadPage.links | where-object href -match $reArchive | select-object -expand href + $fileName64 = $url64 -split '/' | select-object -last 1 + + $version = $url64 -match $reRawVersion | foreach-object { '{0}.{1}' -f $Matches.Major, $Matches.Minor } + + return @{ + Url64 = $url64 + FileName64 = $fileName64 + FileType = 'zip' + Version = $version + } +} + +update -ChecksumFor none -NoReadme