Skip to content

Commit

Permalink
Fix Issue #1
Browse files Browse the repository at this point in the history
Fix issue #1
  • Loading branch information
hansenjn committed May 22, 2020
1 parent 5fa01ac commit 485779e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>CiliaQ_Preparator_JNH</artifactId>
<groupId>JNH</groupId>
<version>0.0.4-SNAPSHOT</version>
<version>0.0.5-SNAPSHOT</version>

<!-- Plugin Information -->
<url>https://github.com/hansenjn/</url>
Expand Down
23 changes: 10 additions & 13 deletions src/main/java/ciliaQ_Prep_jnh/CiliaQPrepMain.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ciliaQ_Prep_jnh;
/** ===============================================================================
* CiliaQ_Preparator Version 0.0.4
* CiliaQ_Preparator Version 0.0.5
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -14,7 +14,7 @@
* See the GNU General Public License for more details.
*
* Copyright (C) Jan Niklas Hansen
* Date: September 29, 2019 (This Version: May 18, 2020)
* Date: September 29, 2019 (This Version: May 22, 2020)
*
* For any questions please feel free to contact me ([email protected]).
* =============================================================================== */
Expand All @@ -38,7 +38,7 @@
public class CiliaQPrepMain implements PlugIn, Measurements {
//Name variables
static final String PLUGINNAME = "CiliaQ Preparator";
static final String PLUGINVERSION = "0.0.4";
static final String PLUGINVERSION = "0.0.5";

//Fix fonts
static final Font SuperHeadingFont = new Font("Sansserif", Font.BOLD, 16);
Expand Down Expand Up @@ -404,7 +404,6 @@ public void windowClosing(WindowEvent winEvt) {

//processing
int addC = 0;
int indexProc, indexTemp;
for(int c = 0; c < segmentChannels.length; c++){
if(segmentChannels [c]){
if(includeDuplicateChannel [c]){
Expand All @@ -423,7 +422,7 @@ public void windowClosing(WindowEvent winEvt) {
if(chosenAlgorithms [c].equals("CANNY 3D")){
progress.updateBarText("Segment channel " + channelIDs [c] + " with CANNY 3D ...");

segmentUsingCanny3D(tempImp, progress, cannySettings [c], procImp, c);
segmentUsingCanny3D(tempImp, progress, cannySettings [c], procImp, channelIDs [c]);

tempImp.changes = false;
tempImp.close();
Expand Down Expand Up @@ -718,7 +717,7 @@ private static ImagePlus copyChannel(ImagePlus imp, int channel, boolean adjustD
private void segmentUsingCanny3D(ImagePlus channelImp, ProgressDialog progress, ProcessSettings settings, ImagePlus writeImp, int channelWriteImp){
ImagePlus selectedImp;
int indexSelected, indexWriteImp;
double maxValue = Math.pow(2.0, channelImp.getBitDepth()) - 1;
double maxValue = Math.pow(2.0, writeImp.getBitDepth()) - 1;
for(int t = 0; t < channelImp.getNFrames(); t++){
/*
* Extract single time point and
Expand All @@ -731,17 +730,15 @@ private void segmentUsingCanny3D(ImagePlus channelImp, ProgressDialog progress,
* For details see ciliaQ_Prep_jnh.canny3d_thresholder.Processing
* */
selectedImp = ciliaQ_Prep_jnh.canny3d_thresholder.Processing.doProcessing(selectedImp, settings, progress);
// selectedImp.show();
// new WaitForUserDialog("check").show();
// selectedImp.hide();

/*
* Write back to image
* */
for(int s = 0; s < channelImp.getNSlices(); s++){
* */
for(int s = 0; s < selectedImp.getNSlices(); s++){
indexSelected = selectedImp.getStackIndex(1, s+1, 1)-1;
indexWriteImp = writeImp.getStackIndex(channelWriteImp+1, s+1, t+1)-1;
for(int x = 0; x < channelImp.getWidth(); x++){
for(int y = 0; y < channelImp.getHeight(); y++){
for(int x = 0; x < selectedImp.getWidth(); x++){
for(int y = 0; y < selectedImp.getHeight(); y++){
if(selectedImp.getStack().getVoxel(x, y, indexSelected) == 0.0){
writeImp.getStack().setVoxel(x, y, indexWriteImp, 0.0);
}else if(!keepIntensities){
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugins.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# Name: CiliaQ_Prep_JNH

# Author: Jan Niklas Hansen <[email protected]>
# Version: v0.0.4
# Version: v0.0.5
# Date: 2019/09/29
# Requires: ImageJ

Plugins>CiliaQ, "CiliaQ Preparator v0.0.4", ciliaQ_Prep_jnh.CiliaQPrepMain
Plugins>CiliaQ, "CiliaQ Preparator v0.0.5", ciliaQ_Prep_jnh.CiliaQPrepMain

0 comments on commit 485779e

Please sign in to comment.