These are chat archives for fiji/fiji

9th
May 2019
Michael Doube
@mdoube
May 09 01:08
We are getting failing Travis builds at BoneJ2, only for PR merge commits. The code change commits pass all tests (which is why we can approve merging PRs in the first place). Travis is complaining:
[WARNING] Cannot get the branch information from the git repository:
Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref
[WARNING] The requested profile "deploy-to-scijava" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project pom-bonej: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
Michael Doube
@mdoube
May 09 02:33
any ideas @ctrueden ?
Varun Kapoor
@kapoorlab
May 09 04:03
This is just the thing I find annoying about Fiji development cycle, basic utilities are missing, no Kmeans import library with a single line of code as in Python, no this or that, (you want me to enumerate examples?), which are basic imports in python or skimage for example. So please stop promoting Fiji as one stop solution for everything, because then facility engineers as me have a hard time convincing as to why simple/post analysis tools can not be in this Fiji window and Jupyter notebooks are the way to go.
Jan Eglinger
@imagejan
May 09 06:45
@mdoube maven.imagej.net was migrated to maven.scijava.org, so the deployment of SNAPSHOT builds fails. pom-scijava parent needs to be updated to 26.0.0, it seems @ctrueden has filed a PR already: bonej-org/BoneJ2#177
@kapoorlab for many tasks, Fiji is indeed a one-stop solution, because someone somewhere already wrote a plugin to solve a specific task. I you're missing a specific python library, you should be able to use pyimagej to combine ImageJ with Python, no? Please open topics on the forum with any specific issues. Jupyter notebooks are great indeed (and exist for ImageJ as well in imagej/tutorials), but reusing functionality (e.g. importing modules etc.) is difficult across notebooks.
Alessandro Felder
@alessandrofelder
May 09 09:28
@imagejan bonej-org/BoneJ2#177 does not update pom-scijava to 26.0.0 and after approving and merging @ctrueden 's PR I get the same Travis build fail. Will try updating to 26.0.0
Jan Eglinger
@imagejan
May 09 09:36
That must have been an oversight. Yes, updating to 26.0.0 should fix it...
Alessandro Felder
@alessandrofelder
May 09 09:36
Yep, think so too - fingers crossed :D
Jan Eglinger
@imagejan
May 09 11:52

@kapoorlab I don't know what you mean by "a single line of code" for Kmeans in Python, but in Fiji, you can do this, for example:

import weka.clusterers.SimpleKMeans

kmeans = new SimpleKMeans()
kmeans.setNumClusters(3)
kmeans.buildClusterer(instances)

centroids = kmeans.getClusterCentroids()

(Of course you need to set up your instances first, but the same is true for creating a dataframe in Python...)

Varun Kapoor
@kapoorlab
May 09 12:03
```def show_intensity_plot(points,save_dir,name, ymin, ymax, num_clusters, title = None ):
fig, ax = plt.subplots() 
ax.plot(points[:, 1], points[: , 0], '.b', alpha=0.6,
    label='Inlier data')
x_min, x_max = ax.get_xlim()
ax.axis([x_min,x_max, ymin, ymax])
if title is None:
 ax.set_xlabel('Intensity')
else:
 ax.set_xlabel(title)   
ax.set_ylabel('Thickness (um)')
X = np.column_stack([points[:, 1], points[: , 0]])  
kmeans = KMeans(n_clusters=num_clusters) # You want cluster the passenger records into 2
kmeans.fit(X)
y_kmeans = kmeans.predict(X)
plt.scatter(X[:,0], X[:,1], c=y_kmeans, s=50, cmap='viridis')
centers = kmeans.cluster_centers_
plt.scatter(centers[:, 0], centers[:, 1], c='black', s=200, alpha=0.5);
for i in range(0, len(centers)):
 print('X:', centers[i, 0], 'Y: ', centers[i, 1])
 distances = compute_distance(X, centers, num_clusters)
 print('Standard deviation:', np.mean(distances))

if title is not None:
 plt.savefig(save_dir + "/" + name + " Thickness-" + title + '.png')
else:
 plt.savefig(save_dir + "/" + name + " Thickness-" + "Intensity" + '.png')  
plt.show()```
@imagejan in python I can do also plotting, saving figures and also writing it in csv files, Fiji plotting tools are not comparable to python plotting tools. Other issues: If I want to do two color bead registration I also want the same plugin to save and apply this transformation on other two color images, I am not happy if I have to turn another plugin on just to apply such transformations which may and may not work, so far my users are using Matlab for that as I can not recommend one pit stop plugin in Fiji that can do the job for them. Fiji plugins should be grouped in a tree by usability or some categories, otherwise even before I can find a plugin in Fiji that can do what I want it would be quicker for me if I just wrote something on my own for that.
Jan Eglinger
@imagejan
May 09 12:13
Sorry, @kapoorlab, I don't understand why you're ranting here. For some tasks, Python is better suited, for others Fiji (and for yet others, e.g. plotting, I prefer R and ggplot2; and KNIME for putting it all together...).
Nobody is "promoting Fiji as one stop solution for everything" here. Please, if you have specific issues, let's discuss on the forum. What you posted above comes across as not very constructive IMHO.
Curtis Rueden
@ctrueden
May 09 13:35
@alessandrofelder @mdoube @imagejan Sorry my PR failed to update to pom-scijava 26.0.0. Somehow my update script—which was supposed to do it—did not do it. I agree that the solution is indeed to update to pom-scijava 26, though.
@kapoorlab At this point, the scientific Python ecosystem has tremendously more momentum behind it than the Java/ImageJ/Fiji ecosystem. If you find Python better for your use, then by all means use Python. We cannot magically make ImageJ/Fiji “catch up” for every Python feature you like, though.
I agree with @imagejan that you should post specific issues on the forum. Thanks.
Hadrien Mary
@hadim
May 09 13:38
@kapoorlab Most of the issue you are raising are Java specific and not really related to Fiji. As an engineer it's up to you to look for the best tool for your users in term of installation/performance/GUI/development etc. I don't think sentences such as "promoting Fiji as one stop solution for everything" is helping the community.
Fiji is great because it's on-click cross platform and come with a GUI (quite old but still very relevant). Also the software is well established in the biological community. Python ecosystem is much bigger and much more general but while being cross platform, Python packaging is still a nightmare (this is a topic I know well). So it will be harder to install/maintain for someone not familiar with Python and programming language (thanks to Conda which makes the process much easier). If you have a specific task you want to perform and struggle between Fiji and Python, I would be happy to help you choose the right tools.
Alessandro Felder
@alessandrofelder
May 09 13:43
@ctrueden no worries, yes, updating the parent to pom-scijava 26 fixed it. Thanks.
Varun Kapoor
@kapoorlab
May 09 15:48
Sorry if I upset somebody, but it is the users in the end who expect everything to just work inside Fiji, like two color registration with beads and then applying the transformation to other two channel images and there are more examples. But I will make a forum post about those issues, in the end its all about making solutions quickly available and convincing them to consider using other tools is not easy sometimes because they hear talks about Fiji being able to do it all so they blame me for not making it possible for them in quick and easy way, but no offense to Fiji :), it is great for many things of course.
Curtis Rueden
@ctrueden
May 09 16:16
@kapoorlab Same for all of us. Blame the devs for not making it perfect! Don’t bother learning how to code and fix things yourself—no one (except for the Fiji devs, apparently) has time to do that.
Less sarcastically: when users ask you why something doesn’t work, just tell them: “Because coding is difficult and time-consuming. Fortunately, with open source—unlike with closed-source software—you can fix it yourself if it’s important enough to justify the time."