EBImage Sample code errors
1
0
Entering edit mode
Robert Baer ▴ 70
@robert-baer-4660
Last seen 2.5 years ago
United States
I get the following errors when running the EBImage introductory sample code: >################################################### >### code chunk number 11: math2 >################################################### >lena4 = lena[299:376, 224:301] Error in slot(lena, ".Data")[299:376, 224:301] : incorrect number of dimensions >lena5 = lena>0.5 >lena6 = t(lena) Error in t.default(lena) : argument is not a matrix >print(median(lena)) [1] 0.3803922 > Can any when help me understand what is going on? Did something go from S3 to S4 that changes the way this code should be written? Thanks, Rob [[alternative HTML version deleted]]
GO EBImage GO EBImage • 1.8k views
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 5 months ago
United States
On Wed, Jul 18, 2012 at 3:36 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: > I get the following errors when running the EBImage introductory sample > code: > >>################################################### >>### code chunk number 11: math2 >>################################################### >>lena4 = lena[299:376, 224:301] > Error in slot(lena, ".Data")[299:376, 224:301] : > incorrect number of dimensions >>lena5 = lena>0.5 >>lena6 = t(lena) > Error in t.default(lena) : argument is not a matrix >>print(median(lena)) > [1] 0.3803922 >> > > Can any when help me understand what is going on? > Can you send the output of sessionInfo() after receiving this error? Dan > Did something go from S3 to S4 that changes the way this code should be written? > > Thanks, > > Rob > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
On 7/18/2012 5:59 PM, Dan Tenenbaum wrote: > On Wed, Jul 18, 2012 at 3:36 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: >> I get the following errors when running the EBImage introductory sample >> code: >> >>> ################################################### >>> ### code chunk number 11: math2 >>> ################################################### >>> lena4 = lena[299:376, 224:301] >> Error in slot(lena, ".Data")[299:376, 224:301] : >> incorrect number of dimensions >>> lena5 = lena>0.5 >>> lena6 = t(lena) >> Error in t.default(lena) : argument is not a matrix >>> print(median(lena)) >> [1] 0.3803922 >> Can any when help me understand what is going on? >> > Can you send the output of sessionInfo() after receiving this error? > Dan > Sorry! I should have done this in the first place :-( > sessionInfo() R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] EBImage_3.12.0 abind_1.4-0 > R.Version() $platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw32" $status [1] "" $major [1] "2" $minor [1] "15.1" $year [1] "2012" $month [1] "06" $day [1] "22" $`svn rev` [1] "59607" $language [1] "R" $version.string [1] "R version 2.15.1 (2012-06-22)" $nickname [1] "Roasted Marshmallows" > >> Did something go from S3 to S4 that changes the way this code should be written? >> >> Thanks, >> >> Rob >> >> >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
On Wed, Jul 18, 2012 at 4:39 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: > On 7/18/2012 5:59 PM, Dan Tenenbaum wrote: >> >> On Wed, Jul 18, 2012 at 3:36 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: >>> >>> I get the following errors when running the EBImage introductory sample >>> code: >>> >>>> ################################################### >>>> ### code chunk number 11: math2 >>>> ################################################### >>>> lena4 = lena[299:376, 224:301] >>> >>> Error in slot(lena, ".Data")[299:376, 224:301] : >>> incorrect number of dimensions >>>> >>>> lena5 = lena>0.5 >>>> lena6 = t(lena) >>> >>> Error in t.default(lena) : argument is not a matrix >>>> >>>> print(median(lena)) >>> >>> [1] 0.3803922 >>> Can any when help me understand what is going on? >>> >> Can you send the output of sessionInfo() after receiving this error? >> Dan >> > Sorry! I should have done this in the first place :-( > >> sessionInfo() > R version 2.15.1 (2012-06-22) > Platform: i386-pc-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 > [2] LC_CTYPE=English_United States.1252 > [3] LC_MONETARY=English_United States.1252 > [4] LC_NUMERIC=C > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] EBImage_3.12.0 abind_1.4-0 Our Windows release build machine has the same sessionInfo() after loading EBImage, it builds this vignette just fine. So I wonder if it is a problem with the external dependencies GTK+ and ImageMagick. I assume you installed them as described here: http://bioconductor.org/packages/release/bioc/vignettes/EBImage/inst/d oc/EBImage-installation.pdf What happens if you open a command window and type echo %PATH% also, what about this command: convert ? Dan >> R.Version() > $platform > [1] "i386-pc-mingw32" > > $arch > [1] "i386" > > $os > [1] "mingw32" > > $system > [1] "i386, mingw32" > > $status > [1] "" > > $major > [1] "2" > > $minor > [1] "15.1" > > $year > [1] "2012" > > $month > [1] "06" > > $day > [1] "22" > > $`svn rev` > [1] "59607" > > $language > [1] "R" > > $version.string > [1] "R version 2.15.1 (2012-06-22)" > > $nickname > [1] "Roasted Marshmallows" > > >> > >>> Did something go from S3 to S4 that changes the way this code should be >>> written? >>> >>> Thanks, >>> >>> Rob >>> >>> >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at r-project.org >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor > > >
ADD REPLY
0
Entering edit mode
On 7/18/2012 6:51 PM, Dan Tenenbaum wrote: > On Wed, Jul 18, 2012 at 4:39 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: >> On 7/18/2012 5:59 PM, Dan Tenenbaum wrote: >>> On Wed, Jul 18, 2012 at 3:36 PM, Robert Baer <rbaer at="" atsu.edu=""> wrote: >>>> I get the following errors when running the EBImage introductory sample >>>> code: >>>> >>>>> ################################################### >>>>> ### code chunk number 11: math2 >>>>> ################################################### >>>>> lena4 = lena[299:376, 224:301] >>>> Error in slot(lena, ".Data")[299:376, 224:301] : >>>> incorrect number of dimensions >>>>> lena5 = lena>0.5 >>>>> lena6 = t(lena) >>>> Error in t.default(lena) : argument is not a matrix >>>>> print(median(lena)) >>>> [1] 0.3803922 >>>> Can any when help me understand what is going on? >>>> >>> Can you send the output of sessionInfo() after receiving this error? >>> Dan >>> >> Sorry! I should have done this in the first place :-( >> >>> sessionInfo() >> R version 2.15.1 (2012-06-22) >> Platform: i386-pc-mingw32/i386 (32-bit) >> >> locale: >> [1] LC_COLLATE=English_United States.1252 >> [2] LC_CTYPE=English_United States.1252 >> [3] LC_MONETARY=English_United States.1252 >> [4] LC_NUMERIC=C >> [5] LC_TIME=English_United States.1252 >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] EBImage_3.12.0 abind_1.4-0 > Our Windows release build machine has the same sessionInfo() after > loading EBImage, it builds this vignette just fine. So I wonder if it > is a problem with the external dependencies GTK+ and ImageMagick. I > assume you installed them as described here: > http://bioconductor.org/packages/release/bioc/vignettes/EBImage/inst /doc/EBImage-installation.pdf > > What happens if you open a command window and type > > echo %PATH% > > also, what about this command: > > convert Thanks for the useful ideas Dan, but I have not yet made useful progress. To answer your follow-up queries: C:\Users\rbaer>echo %path% C:\GTK\bin;C:\Program Files (x86)\ImageMagick-6.7.8-Q16;C:\Windows\system32;C:\Windows;C:\Windows\ System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ggobi; Typing 'convert' at the command prompt produces an extensive list of what appear to be possible flags for imageMagick I am using a 64-bit Windows 7 (Enterprise edition) OS but the 32-bit R when I get this error. I think both the ImageMagick and GTK+ are designed for 32-bit, and should therefore match the R I'm using. Just for clarification, the whole vignette runs just as expected EXCEPT for code chunk 11 where lena4 and lena6 are supposedly created and code chunk 12 when lena4 and lena6 are supposedly saved (because they didn't create. lena5 works fine. Both fail with the errors indicated above. The rest of the code runs and produces images as expected (or at least without error and with images appearing and/or getting saved). lena6 is created in the vignette code as a transpose of lena (an "image" object) ostensibly because it is not a matrix. It appears that this line of code is using t.default suggesting that this generic function doesn't have an "Image" method. Should it? Would this be a method supplied by EBImage or some other package? This makes me suspect some sort of R issue, but I don't know enough about GTK+ or ImageMagick to eliminate issues there. # Version notation. EBImage_3.12.0 abind_1.4-0 # structure and class of the lena object that fails when I attempt to make lena4 & lena6 objects > str(lena) Formal class 'Image' [package "EBImage"] with 2 slots ..@ .Data : num [1:512, 1:512, 1:3] 0.537 0.537 0.537 0.533 0.541 ... ..@ colormode: int 2 > class(lena) [1] "Image" attr(,"package") [1] "EBImage" > # The installation instructions provide the following: # System Requirements ImageMagick (>= 6.3.7), GTK+ (> 2.6) # I have: # ImageMagick 6.7.8-2 Q16(2012-07-01) # GTk+ Runtime Environment 2.10.11-1 # # The computer is a 64-bit windows 7 OS running R i386-pc-mingw32/i386 (32-bit)
ADD REPLY
0
Entering edit mode
Dear Robert, The issue you're mentioning seems to be a Windows-specific bug that we don't see when building the Linux version of the package. I'm having a look. Thanks, Greg On Thu, Jul 19, 2012 at 8:31 AM, Robert Baer <rbaer@atsu.edu> wrote: > On 7/18/2012 6:51 PM, Dan Tenenbaum wrote: > >> On Wed, Jul 18, 2012 at 4:39 PM, Robert Baer <rbaer@atsu.edu> wrote: >> >>> On 7/18/2012 5:59 PM, Dan Tenenbaum wrote: >>> >>>> On Wed, Jul 18, 2012 at 3:36 PM, Robert Baer <rbaer@atsu.edu> wrote: >>>> >>>>> I get the following errors when running the EBImage introductory sample >>>>> code: >>>>> >>>>> ##############################**##################### >>>>>> ### code chunk number 11: math2 >>>>>> ##############################**##################### >>>>>> lena4 = lena[299:376, 224:301] >>>>>> >>>>> Error in slot(lena, ".Data")[299:376, 224:301] : >>>>> incorrect number of dimensions >>>>> >>>>>> lena5 = lena>0.5 >>>>>> lena6 = t(lena) >>>>>> >>>>> Error in t.default(lena) : argument is not a matrix >>>>> >>>>>> print(median(lena)) >>>>>> >>>>> [1] 0.3803922 >>>>> Can any when help me understand what is going on? >>>>> >>>>> Can you send the output of sessionInfo() after receiving this error? >>>> Dan >>>> >>>> Sorry! I should have done this in the first place :-( >>> >>> sessionInfo() >>>> >>> R version 2.15.1 (2012-06-22) >>> Platform: i386-pc-mingw32/i386 (32-bit) >>> >>> locale: >>> [1] LC_COLLATE=English_United States.1252 >>> [2] LC_CTYPE=English_United States.1252 >>> [3] LC_MONETARY=English_United States.1252 >>> [4] LC_NUMERIC=C >>> [5] LC_TIME=English_United States.1252 >>> >>> attached base packages: >>> [1] stats graphics grDevices utils datasets methods base >>> >>> other attached packages: >>> [1] EBImage_3.12.0 abind_1.4-0 >>> >> Our Windows release build machine has the same sessionInfo() after >> loading EBImage, it builds this vignette just fine. So I wonder if it >> is a problem with the external dependencies GTK+ and ImageMagick. I >> assume you installed them as described here: >> http://bioconductor.org/**packages/release/bioc/** >> vignettes/EBImage/inst/doc/**EBImage-installation.pdf<http: biocon="" ductor.org="" packages="" release="" bioc="" vignettes="" ebimage="" inst="" doc="" ebimage-="" installation.pdf=""> >> >> What happens if you open a command window and type >> >> echo %PATH% >> >> also, what about this command: >> >> convert >> > Thanks for the useful ideas Dan, but I have not yet made useful progress. > To answer your follow-up queries: > > C:\Users\rbaer>echo %path% > C:\GTK\bin;C:\Program Files (x86)\ImageMagick-6.7.8-Q16;C:** > \Windows\system32;C:\Windows;**C:\Windows\System32\Wbem;C:\** > Windows\System32\**WindowsPowerShell\v1.0\;C:\**Program Files\ggobi; > > Typing 'convert' at the command prompt produces an extensive list of what > appear to be possible flags for imageMagick > > I am using a 64-bit Windows 7 (Enterprise edition) OS but the 32-bit R > when I get this error. I think both the ImageMagick and GTK+ are designed > for 32-bit, and should therefore match the R I'm using. > > Just for clarification, the whole vignette runs just as expected EXCEPT > for code chunk 11 where lena4 and lena6 are supposedly created and code > chunk 12 when lena4 and lena6 are supposedly saved (because they didn't > create. lena5 works fine. Both fail with the errors indicated above. The > rest of the code runs and produces images as expected (or at least without > error and with images appearing and/or getting saved). lena6 is created in > the vignette code as a transpose of lena (an "image" object) ostensibly > because it is not a matrix. It appears that this line of code is using > t.default suggesting that this generic function doesn't have an "Image" > method. Should it? Would this be a method supplied by EBImage or some > other package? This makes me suspect some sort of R issue, but I don't > know enough about GTK+ or ImageMagick to eliminate issues there. > > # Version notation. EBImage_3.12.0 abind_1.4-0 > # structure and class of the lena object that fails when I attempt to make > lena4 & lena6 objects > > str(lena) > Formal class 'Image' [package "EBImage"] with 2 slots > ..@ .Data : num [1:512, 1:512, 1:3] 0.537 0.537 0.537 0.533 0.541 ... > ..@ colormode: int 2 > > > class(lena) > [1] "Image" > attr(,"package") > [1] "EBImage" > > > > # The installation instructions provide the following: > # System Requirements ImageMagick (>= 6.3.7), GTK+ (> 2.6) > # I have: > # ImageMagick 6.7.8-2 Q16(2012-07-01) > # GTk+ Runtime Environment 2.10.11-1 > # > # The computer is a 64-bit windows 7 OS running R i386-pc- mingw32/i386 > (32-bit) > > > ______________________________**_________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/**listinfo/bioconductor<https: stat.et="" hz.ch="" mailman="" listinfo="" bioconductor=""> > Search the archives: http://news.gmane.org/gmane.** > science.biology.informatics.**conductor<http: news.gmane.org="" gmane.="" science.biology.informatics.conductor=""> > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 633 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6