Search
Question: EBImage computeFeatures error
0
gravatar for Mathieu Gendarme
22 days ago by
Mathieu Gendarme10 wrote:

Dear all,

I upgraded my WS with R 3.5.1 and EBImage version 3.8 and since than am having problems running script that were working fine under R 3.4.4.

I am providing here examples of the script and of the data that lead to problems.

Example script:

https://www.dropbox.com/s/h6v6wcsg8jp3d7f/IFscript_IF015.R?dl=0

Data:

https://www.dropbox.com/s/40e5tfohgdm9wlo/IF015_plate002_test.zip?dl=0

The error I get is coming from the computeFatures function:
 Error in (function (..., deparse.level = 1)  :
  number of rows of matrices must match (see arg 3)

I am wondering if this is a problem from the new version of EBimage or of compatibility with R 3.5.1.

Could someone help me with this issue?

Many thanks in advance.

Mathieu

 

 

 

ADD COMMENTlink modified 22 days ago by Mike Smith3.1k • written 22 days ago by Mathieu Gendarme10

Can you update your post to include the output of the command sessionInfo(), so we can see the exact versions you're using. I've don't get this error when I run through your script (with a few changes to fix the plate number to 2).

ADD REPLYlink modified 22 days ago • written 22 days ago by Mike Smith3.1k

Hi Mike,

 

Sure I can provide this information:

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_Germany.1252  LC_CTYPE=English_Germany.1252    LC_MONETARY=English_Germany.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] EBImage_4.24.0    viridis_0.5.1     viridisLite_0.3.0 hexbin_1.27.2     bindrcpp_0.2.2    xlsx_0.6.1        data.table_1.11.8 magrittr_1.5     
 [9] reshape2_1.4.3    forcats_0.3.0     stringr_1.3.1     dplyr_0.7.8       purrr_0.2.5       readr_1.1.1       tidyr_0.8.2       tibble_1.4.2     
[17] ggplot2_3.1.0     tidyverse_1.2.1  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0          locfit_1.5-9.1      lubridate_1.7.4     lattice_0.20-35     fftwtools_0.9-8     png_0.1-7           xlsxjars_0.6.1     
 [8] assertthat_0.2.0    digest_0.6.18       utf8_1.1.4          R6_2.3.0            tiff_0.1-5          cellranger_1.1.0    plyr_1.8.4         
[15] backports_1.1.2     httr_1.3.1          pillar_1.3.0        rlang_0.3.0.1       lazyeval_0.2.1      readxl_1.1.0        rstudioapi_0.8     
[22] labeling_0.3        htmlwidgets_1.3     RCurl_1.95-4.11     munsell_0.5.0       broom_0.5.0         compiler_3.5.1      modelr_0.1.2       
[29] pkgconfig_2.0.2     BiocGenerics_0.28.0 htmltools_0.3.6     tidyselect_0.2.5    gridExtra_2.3       fansi_0.4.0         crayon_1.3.4       
[36] withr_2.1.2         bitops_1.0-6        grid_3.5.1          nlme_3.1-137        jsonlite_1.5        gtable_0.2.0        scales_1.0.0       
[43] cli_1.0.1           stringi_1.2.4       xml2_1.2.0          tools_3.5.1         glue_1.3.0          hms_0.4.2           jpeg_0.1-8         
[50] abind_1.4-5         parallel_3.5.1      yaml_2.2.0          colorspace_1.3-2    rvest_0.3.2         rJava_0.9-10        bindr_0.1.1        
[57] haven_1.1.2      

 

 

ADD REPLYlink written 22 days ago by Mathieu Gendarme10
2
gravatar for Mike Smith
22 days ago by
Mike Smith3.1k
EMBL Heidelberg / de.NBI
Mike Smith3.1k wrote:

I can't reproduce this error at the moment.  I've made a modified version of your example script available at https://gist.github.com/grimbough/09d150bff2b07ec032de4d47cf201215

The main changes were to remove all the comment out lines so it was easier for me to read, automated the downloading & unzipping of the files, and modified line 24 as I think my directory structure is slightly different from what the script was expecting.

The code runs without error for me and prints out the following:

[1] "Plate: 2; Well: A5; Position: 00001; Time:2018-11-19 18:29:39"
[1] "Plate: 2; Well: A5; Position: 00002; Time:2018-11-19 18:30:02"
[1] "Plate: 2; Well: A5; Position: 00003; Time:2018-11-19 18:30:19"
[1] "Plate: 2; Well: A5; Position: 00004; Time:2018-11-19 18:30:35"
[1] "Plate: 2; Well: A5; Position: 00005; Time:2018-11-19 18:30:53"
[1] "Plate: 2; Well: A5; Position: 00006; Time:2018-11-19 18:31:24"
[1] "Plate: 2; Well: A5; Position: 00007; Time:2018-11-19 18:31:50"
[1] "Plate: 2; Well: A5; Position: 00008; Time:2018-11-19 18:32:07"
[1] "Plate: 2; Well: A5; Position: 00009; Time:2018-11-19 18:32:22"

and produces some CSV files:

> list.files(pattern = '.csv')
[1] "IF015_noSpeck_p--2_w--A5_pos--00001.csv"
[2] "IF015_noSpeck_p--2_w--A5_pos--00002.csv"
[3] "IF015_noSpeck_p--2_w--A5_pos--00003.csv"
[4] "IF015_noSpeck_p--2_w--A5_pos--00004.csv"
[5] "IF015_noSpeck_p--2_w--A5_pos--00005.csv"
[6] "IF015_noSpeck_p--2_w--A5_pos--00006.csv"
[7] "IF015_noSpeck_p--2_w--A5_pos--00007.csv"
[8] "IF015_noSpeck_p--2_w--A5_pos--00008.csv"
[9] "IF015_noSpeck_p--2_w--A5_pos--00009.csv"

You can source it directly with the following command.  If it runs for you then take a look at the differences between the two scripts, if not then report back here & we can keep hunting

source('https://gist.githubusercontent.com/grimbough/09d150bff2b07ec032de4d47cf201215/raw/4ba02b5645e67a3ec937efe16feb4412fc30ac93/IF015_example.R')

Here's my sessionInfo() for reference:

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19

Matrix products: default
BLAS: /home/msmith/Applications/R/R-3.5.1/lib/libRblas.so
LAPACK: /home/msmith/Applications/R/R-3.5.1/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] bindrcpp_0.2.2  forcats_0.3.0   stringr_1.3.1   dplyr_0.7.8     purrr_0.2.5    
 [6] readr_1.1.1     tidyr_0.8.2     tibble_1.4.2    ggplot2_3.1.0   tidyverse_1.2.1
[11] EBImage_4.24.0 

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5    locfit_1.5-9.1      haven_1.1.2         lattice_0.20-38    
 [5] colorspace_1.3-2    htmltools_0.3.6     yaml_2.2.0          rlang_0.3.0.1      
 [9] pillar_1.3.0        withr_2.1.2         glue_1.3.0          BiocGenerics_0.28.0
[13] modelr_0.1.2        readxl_1.1.0        jpeg_0.1-8          bindr_0.1.1        
[17] plyr_1.8.4          munsell_0.5.0       gtable_0.2.0        cellranger_1.1.0   
[21] rvest_0.3.2         htmlwidgets_1.3     parallel_3.5.1      broom_0.5.0        
[25] Rcpp_1.0.0          backports_1.1.2     scales_1.0.0        jsonlite_1.5       
[29] abind_1.4-5         hms_0.4.2           png_0.1-7           digest_0.6.18      
[33] stringi_1.2.4       tiff_0.1-5          grid_3.5.1          cli_1.0.1          
[37] tools_3.5.1         bitops_1.0-6        magrittr_1.5        RCurl_1.95-4.11    
[41] lazyeval_0.2.1      crayon_1.3.4        pkgconfig_2.0.2     xml2_1.2.0         
[45] lubridate_1.7.4     assertthat_0.2.0    httr_1.3.1          rstudioapi_0.8     
[49] R6_2.3.0            fftwtools_0.9-8     nlme_3.1-137        compiler_3.5.1
ADD COMMENTlink modified 21 days ago • written 22 days ago by Mike Smith3.1k

Thanks a lot for your help.

It seems that I have a bigger problem as downgrading is an issue.

I tried this (before installing EBImage from a ealier version):

> BiocManager::install(version = "3.7") # latest 3.8

Getting this error:

 Bioconductor version 3.7 (BiocManager 1.30.4), R 3.5.1 (2018-07-02)
installation path not writeable, unable to update packages: foreign, lattice, MASS, Matrix, mgcv, survival

I tried this to solve the problem but it persists:

remove.packages(c("Matrix", "mgcv", "survival", "foreign", "lattice", "MASS"))
install.packages(c("Matrix", "mgcv", "survival", "foreign", "lattice", "MASS"))

Any idea where the problem could be coming from? I have seen people reporting the issue and even when I try to install the packages in the directories provided by .libPaths the problem persists.

Many thanks in advance.

Cheers

 

ADD REPLYlink modified 21 days ago • written 21 days ago by Mathieu Gendarme10
1

Those are all packages that are installed with R.  What's probably happened is that R was installed with administrator privileges and you're now running it as a regular user who doesn't have permission to write to that location.

You'll probably find that the Bioconductor packages have been updated anyway, and you can check the status with BiocManager::valid() which will report whether the installed packages are appropriate for your selected Bioconductor version.

If you still want to update the reported packages you'll either need to edit the permissions on that location or make sure that the first entry in the output from .libPaths() is somewhere you have permission to write to.

ADD REPLYlink written 21 days ago by Mike Smith3.1k

Thanks for the advice. I did manage to do it and to be on the safe side I even re-installed fresh R and RStudio with all libraries (which did work once I got the admin rights).

I then tried to re-run the script I sent and got the same error after Position 00004

[1] "Plate: 2; Well: A5; Position: 00001; Time:2018-11-20 16:31:44"
[1] "Plate: 2; Well: A5; Position: 00002; Time:2018-11-20 16:32:11"
[1] "Plate: 2; Well: A5; Position: 00003; Time:2018-11-20 16:32:28"
[1] "Plate: 2; Well: A5; Position: 00004; Time:2018-11-20 16:32:42"

Error in (function (..., deparse.level = 1) : number of rows of matrices must match (see arg 3)

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_Germany.1252  LC_CTYPE=English_Germany.1252    LC_MONETARY=English_Germany.1252
[4] LC_NUMERIC=C                     LC_TIME=English_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] bindrcpp_0.2.2  forcats_0.3.0   stringr_1.3.1   dplyr_0.7.8     purrr_0.2.5     readr_1.1.1     tidyr_0.8.2    
 [8] tibble_1.4.2    ggplot2_3.1.0   tidyverse_1.2.1 EBImage_4.24.0 

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5    locfit_1.5-9.1      haven_1.1.2         lattice_0.20-38     colorspace_1.3-2   
 [6] htmltools_0.3.6     yaml_2.2.0          rlang_0.3.0.1       pillar_1.3.0        withr_2.1.2        
[11] glue_1.3.0          BiocGenerics_0.28.0 modelr_0.1.2        readxl_1.1.0        jpeg_0.1-8         
[16] bindr_0.1.1         plyr_1.8.4          munsell_0.5.0       gtable_0.2.0        cellranger_1.1.0   
[21] rvest_0.3.2         htmlwidgets_1.3     parallel_3.5.1      broom_0.5.0         Rcpp_1.0.0         
[26] backports_1.1.2     scales_1.0.0        jsonlite_1.5        abind_1.4-5         hms_0.4.2          
[31] png_0.1-7           digest_0.6.18       stringi_1.2.4       tiff_0.1-5          grid_3.5.1         
[36] cli_1.0.1           tools_3.5.1         bitops_1.0-6        magrittr_1.5        RCurl_1.95-4.11    
[41] lazyeval_0.2.1      crayon_1.3.4        pkgconfig_2.0.2     xml2_1.2.0          lubridate_1.7.4    
[46] assertthat_0.2.0    httr_1.3.1          rstudioapi_0.8      R6_2.3.0            fftwtools_0.9-8    
[51] nlme_3.1-137        compiler_3.5.1     
 

>

I really do not understand where this is coming from.

ADD REPLYlink written 21 days ago by Mathieu Gendarme10

I also did try your script Mike and I get the exact same issue. I really don't know anymore how to tackle this problem.

ADD REPLYlink written 21 days ago by Mathieu Gendarme10

This is very strange.  According to two sessionInfo() outputs we are using exactly the same versions of R and all packages.  I've also dug out a Windows machine & tested there, but I don't get the error.  If I copy and paste my source() example into a new R session it just runs to completion.

I'm not really sure what more to look at...

ADD REPLYlink written 21 days ago by Mike Smith3.1k

Just to mention I did try to run this as well on a linux machine with ubuntu 18.04 and get the exact same message...

Very strange that it doesn't happen to you Mike. Something must be wrong at my side.

ADD REPLYlink written 20 days ago by Mathieu Gendarme10

I tried running Mike's script under Mac OS but couldn't reproduce the issue too.

Mathieu, could you maybe run traceback() after you encounter the error and paste the output?

Cheers,

Andrzej

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] bindrcpp_0.2.2  forcats_0.3.0   stringr_1.3.1   dplyr_0.7.8    
 [5] purrr_0.2.5     readr_1.1.1     tidyr_0.8.2     tibble_1.4.2   
 [9] ggplot2_3.1.0   tidyverse_1.2.1 EBImage_4.24.0 

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5    locfit_1.5-9.1      haven_1.1.2        
 [4] lattice_0.20-38     colorspace_1.3-2    htmltools_0.3.6    
 [7] yaml_2.2.0          rlang_0.3.0.1       pillar_1.3.0       
[10] withr_2.1.2         glue_1.3.0          BiocGenerics_0.28.0
[13] modelr_0.1.2        readxl_1.1.0        jpeg_0.1-8         
[16] bindr_0.1.1         plyr_1.8.4          munsell_0.5.0      
[19] gtable_0.2.0        cellranger_1.1.0    rvest_0.3.2        
[22] htmlwidgets_1.3     parallel_3.5.1      broom_0.5.0        
[25] Rcpp_1.0.0          backports_1.1.2     scales_1.0.0       
[28] BiocManager_1.30.4  jsonlite_1.5        abind_1.4-5        
[31] hms_0.4.2           png_0.1-7           digest_0.6.18      
[34] stringi_1.2.4       tiff_0.1-5          grid_3.5.1         
[37] cli_1.0.1           tools_3.5.1         bitops_1.0-6       
[40] magrittr_1.5        RCurl_1.95-4.11     lazyeval_0.2.1     
[43] crayon_1.3.4        pkgconfig_2.0.2     xml2_1.2.0         
[46] lubridate_1.7.4     assertthat_0.2.0    httr_1.3.1         
[49] rstudioapi_0.8      R6_2.3.0            fftwtools_0.9-8    
[52] nlme_3.1-137        compiler_3.5.1
ADD REPLYlink modified 20 days ago • written 20 days ago by Andrzej Oleś720

Thanks Andrzej for trying it out,

Here is what get from the traceback:

[1] "Plate: 2; Well: A5; Position: 00001; Time:2018-11-21 12:32:21"
[1] "Plate: 2; Well: A5; Position: 00002; Time:2018-11-21 12:32:41"
[1] "Plate: 2; Well: A5; Position: 00003; Time:2018-11-21 12:32:56"
[1] "Plate: 2; Well: A5; Position: 00004; Time:2018-11-21 12:33:11"

Error in (function (..., deparse.level = 1) : number of rows of matrices must match (see arg 3)
6.
(function (..., deparse.level = 1) .Internal(cbind(deparse.level, ...)))(structure(c(0.114300891966379, 0.179163016402181, 0.140598748369709, 0.152800871444939, 0.0736651962352124, 0.0849077136455774, 0.0781870951580938, 0.0863704127602788, 0.118474513370105, ...
5.
do.call(cbind, lapply(methods.ref, do.call, list(x = x, ref = ref[[i]], properties = FALSE, xs = xs, ...)))
4.
FUN(X[[i]], ...)
3.
lapply(1:nref, function(i) { do.call(cbind, lapply(methods.ref, do.call, list(x = x, ref = ref[[i]], properties = FALSE, xs = xs, ...))) })
2.
computeFeatures(Donut, Img488, xname = "Donut", refnames = "488", haralick.nbins = 32, haralick.scales = c(1, 2, 4, 8))
1.
ImageProcessing(Image = AllImages, Plate = Plate, Well = Well, Position = Position)
ADD REPLYlink written 20 days ago by Mathieu Gendarme10

Thank you Mathieu!

I'm not entirely sure yet what could be wrong. But according to the error message it seems that things fails when trying to cbind the results of computeFeatures.basic, computeFeatures.moment, and computeFeatures.haralick. So probably something goes wrong already when computing these such that the results don't match the expected format and thus cannot be combined. Could you maybe save and share the objects Donut and Img488 generated in the failing call to ImageProcessing(Image = AllImages, Plate = 2, Well = "A5", Position = "00004")? For this you might want to run options(error=recover) first.

Cheers, Andrzej

ADD REPLYlink modified 19 days ago • written 19 days ago by Andrzej Oleś720

Hi Andrzej,

I would love to provide the Donut mask and the Img488 outputs. However I have a problem with the Donut, when I want to writeImage it rescales the labels and transforms everything above 0 to 1s. If I do normalize than I get individual values for each mask but not integers which I assume won't be compatible with computeFeatures.

How can I export them with integers values easily?

Thanks

ADD REPLYlink written 18 days ago by Mathieu Gendarme10

The output of

ImageProcessing(Image = AllImages, Plate = 2, Well = "A5", Position = "00005")

with options(error=recover) doesn't change to much.

> ImageProcessing(Image = AllImages, Plate = 2, Well = "A5", Position = "00005")
Error in (function (..., deparse.level = 1)  : 
  number of rows of matrices must match (see arg 3)

Enter a frame number, or 0 to exit   

1: ImageProcessing(Image = AllImages, Plate = 2, Well = "A5", Position = "00005")
2: #53: computeFeatures(Donut, Img488, xname = "Donut", refnames = "488", haralick.nbins = 32, haralick.scales = c(1, 2, 4, 8))
3: lapply(1:nref, function(i) {
    do.call(cbind, lapply(methods.ref, do.call, list(x = x, ref = ref[[i]], properties = FALSE, xs = xs, ...)))
})
4: FUN(X[[i]], ...)
5: do.call(cbind, lapply(methods.ref, do.call, list(x = x, ref = ref[[i]], properties = FALSE, xs = xs, ...)))
6: (function (..., deparse.level = 1) 
.Internal(cbind(deparse.level, ...)))(c(0.114300891966379, 0.179163016402181, 0.140598748369709, 0.152800871444939, 0.073
Selection: 6
Called from: eval(substitute(browser(skipCalls = skip), list(skip = 7 - which)), 
    envir = sys.frame(which))

 

 

ADD REPLYlink written 18 days ago by Mathieu Gendarme10

Please provide the actual R objects written with save rather than image files. Thanks!

ADD REPLYlink modified 18 days ago • written 18 days ago by Andrzej Oleś720

OK that works as well. Please find the two objects here:

https://www.dropbox.com/s/v6y8o0z5vqaj3k8/Donut.RData?dl=0

https://www.dropbox.com/s/nu0888x0nwtti18/Img488.RData?dl=0

Cheers

ADD REPLYlink written 18 days ago by Mathieu Gendarme10

Thank you Mathieu!

Using the object files you provided I could reproduce the described error in a call to computeFeatures(Donut, Img488, xname = "Donut", refnames = "488", haralick.nbins = 32, haralick.scales = c(1, 2, 4, 8)) inside of ImageProcessing(Image = AllImages, Plate = 2, Well = "A5", Position = "00005"). Interestingely, these images are completely different from the ones which are produced on my machine, see http://rpubs.com/aoles/444108. Are we working on the same data? I just use the script provided by Mike.

Cheers, Andrzej

ADD REPLYlink modified 12 days ago • written 12 days ago by Andrzej Oleś720

Thank you very much Andrzej!

You pointed out that the data might not be the right one and you are correct, with the data of my first archive file I do not get an error.

Here is the proper data set leading to a failure at position "00005":

https://www.dropbox.com/s/uog8u6upvlwblxd/IF015_plate002_problematic.zip?dl=0

My apologies for the confusion. At least with have two data sets to play with, one that doesn't lead to problems and one that does.

Cheers,

Mathieu

ADD REPLYlink written 12 days ago by Mathieu Gendarme10

Dear all,

I have made some progress in understanding where the issue is coming from. When I compute individually computeFeatures.basic; computeFeatures.moment; computeFeatures.shape; they return the same amount of rows, however computeFeatures.haralick retrieves a higher amount of rows indicating that more labels are considered when computing the haralick features. I do not know why this happens though.

To circumvent the issue I did compile a custom computeFeatures function. I could run through my entire dataset (the one posted last) with it (I had to change the cbind for multiple merge operations by using the rowname in the feature extraction script). In case other people would have the same issue I am posting it here:

custom_computeFeatures_all <- function(mask, image, xname, refnames , h_nbins, h_scales){
 
  # generate blobbed image
  image_blob = filter2(image, gblob())/2
 
  # compute basic, moment, shape  on origininal image
  temp1_1 <- as.data.frame(cbind(computeFeatures.basic(x = mask, ref = image, xname = xname, refnames = refnames, expandRef = standardExpandRef),
                                 computeFeatures.moment(x = mask, ref = image, xname = xname, refnames = refnames, expandRef = standardExpandRef),
                                 computeFeatures.shape(x = mask, ref = image, xname = xname, refnames = refnames, expandRef = standardExpandRef)
  )
  ) %>% rownames_to_column()
  colnames(temp1_1)[colnames(temp1_1) != "rowname"] <- paste(xname, refnames, colnames(temp1_1)[colnames(temp1_1) != "rowname"], sep = ".")
 
  # compute basic, moment, shape  on blobbed image
  temp1_2 <- as.data.frame(cbind(computeFeatures.basic(x = mask, ref = image_blob, xname = xname, refnames = refnames, expandRef = standardExpandRef),
                                 computeFeatures.moment(x = mask, ref = image_blob, xname = xname, refnames = refnames, expandRef = standardExpandRef),
                                 computeFeatures.shape(x = mask, ref = image_blob, xname = xname, refnames = refnames, expandRef = standardExpandRef)
  )
  ) %>% rownames_to_column()
  colnames(temp1_2)[colnames(temp1_2) != "rowname"] <- paste(paste0(xname, ".B", refnames), colnames(temp1_2)[colnames(temp1_2) != "rowname"], sep = ".")
 
  # compute haralick on origininal image
  temp2_1 <- as.data.frame(computeFeatures.haralick(x = mask, ref = image, xname = xname, refnames = refnames, expandRef=standardExpandRef,
                                                    haralick.nbins = h_nbins, haralick.scales = h_scales)
  ) %>% rownames_to_column()
  colnames(temp2_1)[colnames(temp2_1) != "rowname"] <- paste(xname, refnames, colnames(temp2_1)[colnames(temp2_1) != "rowname"], sep = ".")
 
  # compute haralick on blobbed image
  temp2_2 <- as.data.frame(computeFeatures.haralick(x = mask, ref = image_blob, xname = xname, refnames = refnames, expandRef=standardExpandRef,
                                                    haralick.nbins = h_nbins, haralick.scales = h_scales)
  ) %>% rownames_to_column()
  colnames(temp2_2)[colnames(temp2_2) != "rowname"] <- paste(paste0(xname, ".B", refnames), colnames(temp2_2)[colnames(temp2_2) != "rowname"], sep = ".")
 
  # brings all the data together
  temp <- merge(temp1_1, temp1_2, by = 'rowname', all.x = T, sort = F)  %>%
    merge(temp2_1, by = 'rowname', all.x = T, sort = F)  %>%
    merge(temp2_2, by = 'rowname', all.x = T, sort = F)  
 
  # returns the data
  temp
}

I would still be interested in what triggers the problem as this was not the case before. Just to mention on the side note I am confident that the original computeFeatures function is more computationally efficient than my custom version.

Cheers,

Mathieu

 
ADD REPLYlink written 8 hours ago by Mathieu Gendarme10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 364 users visited in the last hour